C# 如何使用Monotouch.Dialog设置背景图像
在C# 如何使用Monotouch.Dialog设置背景图像,c#,ios,xamarin.ios,monotouch.dialog,C#,Ios,Xamarin.ios,Monotouch.dialog,在Monotouch.Dialog中设置背景图像(位于所有控件下方)的最佳方法是什么?我正在使用Monotouch的元素API。Dialog主要技巧是将表格视图背景色设置为清除,然后将父视图控制器设置为您的图像。查看,如: class MyDialogViewController : DialogViewController { public MyDialogViewController (RootElement root) : base (root) { }
Monotouch.Dialog
中设置背景图像(位于所有控件下方)的最佳方法是什么?我正在使用Monotouch的元素API。Dialog
主要技巧是将表格视图
背景色设置为清除
,然后将父视图控制器设置为您的图像。查看
,如:
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);
}
}