When I set the MonoTouch.Dialog background color to uiclear(transparent), it throw an exception, why? and How to set it to transparent.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object MyDialogViewController.LoadView () [0x00016] in MyDialogViewController.cs: ParentViewController.View.BackgroundColor = UIColor.Clear
public class MyDialogViewController: DialogViewController
{
public MyDialogViewController (RootElement root) : base (root)
{
}
public override void LoadView()
{
base.LoadView ();
this.TableView.BackgroundColor = UIColor.Clear;
ParentViewController.View.BackgroundColor = UIColor.Clear;
}
}
public void xxxxx(){
var menu = new RootElement(""){
new Section ("Demo"){
new EntryElement("Name", "",""),
},
};
var menuDVC = new MyDialogViewController (menu) {
Autorotate = true
};
this.View.AddSubview(menuDVC.View);
}