OGeek|极客世界-中国程序员成长平台

标题: ios - Monotouch/Xamarin 更改 iPad 应用程序的表格行高 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:57
标题: ios - Monotouch/Xamarin 更改 iPad 应用程序的表格行高

我无法弄清楚如何在我的 Xamarin iPad 应用程序中更改表的 rowHeight。以前我在 iPhone 应用程序上工作过,调整行的大小就像在 TableSource 类中调用以下内容一样简单:

public override float GetHeightForRow (UITableView tableView, NSIndexPath indexPath)
        {
            return 95f;
        }

但是,我发现 iPad 应用程序中没有调用它。我应该调用另一种方法吗,还是我完全错了?



Best Answer-推荐答案


看起来您通过覆盖 GetHeightForRow 正确地做到了这一点,但如果它没有改变它,我建议检查 Controller 上的 ViewDidLoad 方法,以确保它将 tableview 源设置为您的自定义 tableSource 类。

例如在ViewDidLoad中:

_tableview.Source = new TableSource();

关于ios - Monotouch/Xamarin 更改 iPad 应用程序的表格行高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25004969/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4