【发布时间】:2011-12-09 04:34:15
【问题描述】:
在Monotouch.Dialog 中设置背景图像(在所有控件下方)的最佳方法是什么?我正在使用Monotouch.Dialog 的Elements API。
【问题讨论】:
标签: c# ios xamarin.ios monotouch.dialog
在Monotouch.Dialog 中设置背景图像(在所有控件下方)的最佳方法是什么?我正在使用Monotouch.Dialog 的Elements API。
【问题讨论】:
标签: c# ios xamarin.ios monotouch.dialog
主要技巧是将TableView背景颜色设置为Clear,然后将ParentViewController.View设置为您的图像,例如:
class MyDialogViewController : DialogViewController {
public MyDialogViewController (RootElement root) : base (root)
{
}
public override void LoadView ()
{
base.LoadView ();
TableView.BackgroundColor = UIColor.Clear;
UIImage background = UIImage.FromFile ("background.png");
ParentViewController.View.BackgroundColor = UIColor.FromPatternImage (background);
}
}
【讨论】: