为什么不能改变Monotouch.Dialog.TableView.Background颜色

Blu*_*Sky 1 c# xamarin.ios ios monotouch.dialog

为什么不能改变MonoTouch.Dialog.TableView.Background颜色?我正在使用MonoTouch.Dialog的Elements API.它还是灰色的!

class MyDialogViewController : DialogViewController {

public MyDialogViewController (RootElement root) : base (root)
{
}

public override void LoadView ()
{
    base.LoadView ();
    TableView.BackgroundColor = UIColor.Clear;
    UIImage background = UIImage.FromFile ("Mybackground.png");
    ParentViewController.View.BackgroundColor = UIColor.FromPatternImage (background);
}
}


public partial class MyVC: UINavigationController
{
    public void CreateTestUI()
    {

            var menu = new RootElement("MyMenu"){
            new Section ("test"){
                new StringElement("Test", delegate() { }), ...

        var dv = new MyDialogViewController (menu) {
            Autorotate = true
        };

        // add the nav controller to the window
        this.PushViewController (dv, true); 
      }
  }
Run Code Online (Sandbox Code Playgroud)

Blu*_*Sky 6

在iPad中,必须添加以下行: TableView.BackgroundView = null;

现在它运作良好,感谢poupou,感谢所有人.

   public override void LoadView()
   {
        base.LoadView();
        TableView.BackgroundView = null;
        TableView.BackgroundColor = UIColor.Black;
   }
Run Code Online (Sandbox Code Playgroud)