0

I'm using the MonoTouch.Dialog reflection API to create a new 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);

If I supply the RootElement with a string value I get a nice title bar with text. I want to control the color of that title bar. I'm not seeing any properties that allow me to do this. Do I need to subclass DialogViewController and build my own title bar?

Billy Coover
  • 3,827
  • 5
  • 36
  • 50

1 Answers1

3

For me, the easiest way to do this is indeed subclassing the DialogViewController, like this:

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);
    }
}
Eduardo Scoz
  • 24,653
  • 6
  • 47
  • 62