【发布时间】:2012-06-06 21:23:54
【问题描述】:
我遇到了this question 中描述的相同问题,只是我使用的是 Monotouch,而不是 Objective-C。我也在使用 Monotouch-Dialog 而不是 Interface Builder。
所以,总结一下这个问题,在 iPad 上,分组 UITableView 的背景始终是灰色的,而在 iPhone 上,它显示标准的条纹背景。当应用程序在 iPad 上运行时,我希望获得相同的条纹背景。
我在 ViewDidLoad 覆盖方法中尝试了以下方法(基于我链接的问题中发布的答案),但它不起作用:
public class SyncDialog : DialogViewController
{
public override void ViewDidLoad ()
{
this.TableView.BackgroundView = new UIView();
base.ViewDidLoad ();
}
}
有谁知道如何让 iPad 上的 Monotouch.Dialog DialogViewController 的背景与 上显示的一致iPhone?
更新:
我还尝试将 tableview 的 BackgroundColor 更改为 UIColor.Clear 作为对同一问题的另一个答案。所以我补充说:
this.TableView.BackgroundColor = UIColor.Clear;
但这也无济于事。我还尝试将 this.TableView.BackgroundView 设置为 null 而不是实例化另一个 UIView 对象。但是通过这两个更改,我只得到了黑色背景。
【问题讨论】:
标签: ipad uitableview xamarin.ios monotouch.dialog