Iphone MonoTouch.对话框:iPad未设置背景图像

Iphone MonoTouch.对话框:iPad未设置背景图像,iphone,ios,xamarin.ios,monotouch.dialog,Iphone,Ios,Xamarin.ios,Monotouch.dialog,使用MonoTouch.Dialog我创建了一个简单的ViewController: 在LoadView中,我设置了背景图像。这适用于iPhone,但不适用于iPad。此时,应用程序没有其他内容: public override void LoadView () { base.LoadView (); var color = UIColor.FromPatternImage (image); TableView.BackgroundColor = UIColor.Clea

使用MonoTouch.Dialog我创建了一个简单的ViewController:

在LoadView中,我设置了背景图像。这适用于iPhone,但不适用于iPad。此时,应用程序没有其他内容:

public override void LoadView ()
{
    base.LoadView ();
    var color = UIColor.FromPatternImage (image);
    TableView.BackgroundColor = UIColor.Clear;
    ParentViewController.View.BackgroundColor = color;
}

iPad没有设置背景有什么原因吗?

在MonoTouch中设置UITableView的背景图像。iPad上的对话框:

TableView.BackgroundView = 
     new UIView(ParentViewController.View.Frame) 
         {BackgroundColor = color};

其中color是UIColor图像

用于在MonoTouch中设置UITableView的背景图像。iPad上的对话框:

TableView.BackgroundView = 
     new UIView(ParentViewController.View.Frame) 
         {BackgroundColor = color};

其中color是UIColor图像

我发现ipad上的TableView具有不同的结构。因此,要设置背景色,请使用:TableView.BackgroundView=newUIView(ParentViewController.View.Frame){BackgroundColor=color};我发现ipad上的TableView具有不同的结构。因此,要设置背景色,请使用:TableView.BackgroundView=newUIView(ParentViewController.View.Frame){BackgroundColor=color};