Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change Title Text Colour of NavigationController in iOS using Xamarin

I am trying to change the Title text Colour of NavigationController in iOS using Xamarin but I am unable to change it.

Could someone please help me in achieving it?

like image 546
user3124624 Avatar asked Jan 21 '14 07:01

user3124624


1 Answers

I tried in this way and it worked for me.

        var navigationBar = NavigationController.NavigationBar;
        navigationBar.SetTitleTextAttributes(new UITextAttributes() { TextColor = UIColor.White });

Sathish

Edit:

UINavigationBar no longer has the method SetTitleTextAttributes. Instead you must set the TitleTextAttributes property to a UIStringAttributes property like so:

this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White };
like image 98
user3124624 Avatar answered Sep 27 '22 02:09

user3124624