Xamarin.ios 对话框:带有反射api的标题栏颜色

Xamarin.ios 对话框:带有反射api的标题栏颜色,xamarin.ios,uitableview,monotouch.dialog,Xamarin.ios,Uitableview,Monotouch.dialog,我正在使用MonoTouch.Dialog反射API创建一个新的DialogViewController: var dashBoard = new RootElement (""){ new Section("My Dashboard", "All alerts, follow-ups, and tasks are automatically synced each time you launch the app") { n

我正在使用MonoTouch.Dialog反射API创建一个新的DialogViewController:

var dashBoard = new RootElement (""){
                new Section("My Dashboard", "All alerts, follow-ups, and tasks are automatically synced each time you launch the app") {
                    new StringElement ("Alerts"),
                    new StringElement ("Follow-ups"),
                    new StringElement ("Tasks")
                }
            };

var dvc = new DialogViewController (dashBoard) {
    Autorotate = true
};
navigation.PushViewController (dvc, true);

如果我给RootElement提供一个字符串值,我会得到一个很好的带有文本的标题栏。我想控制标题栏的颜色。我没有看到任何允许我这样做的属性。我需要对DialogViewController进行子类化并构建自己的标题栏吗?

对我来说,最简单的方法就是对DialogViewController进行子类化,如下所示:

public class CustomDialogViewController : DialogViewController {
     // add constructors here as necessary, dont forget to call base()

    public override void ViewWillAppear (bool animated)
    {
        base.ViewWillAppear (animated);
        this.NavigationController.NavigationBar.TintColor = UIColor.FromRGB(0, 115, 176);
    }
}

对我来说,最简单的方法就是子类化DialogViewController,如下所示:

public class CustomDialogViewController : DialogViewController {
     // add constructors here as necessary, dont forget to call base()

    public override void ViewWillAppear (bool animated)
    {
        base.ViewWillAppear (animated);
        this.NavigationController.NavigationBar.TintColor = UIColor.FromRGB(0, 115, 176);
    }
}