如何在Monotouch.Dialog
中设置一个背景图片(在所有控件下方)?我正在使用Monotouch.Dialog
的Elements
API。
如何在Monotouch.Dialog
中设置一个背景图片(在所有控件下方)?我正在使用Monotouch.Dialog
的Elements
API。
主要的技巧是将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);
}
}