Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the navigation bar title color on Xamarin.iOS

Tags:

xamarin.ios

I'd like to know how to change the navigation bar title's color. This is how it should be done in swift:

UINavigationBar.appearance().titleTextAttributes =
                             [NSForegroundColorAttributeName : UIColor.white]

How can I replicate that behavior using Xamarin.iOS?

I tried working with the answers here What to use for AttributeName in Xamarin Mac but I couldn't make it work because it could not convert from NSMutableAttributedString to UIStringAttributes.

Thanks.

like image 706
eestein Avatar asked Dec 08 '16 11:12

eestein


1 Answers

This is how you do that:

UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes
{
    ForegroundColor = UIColor.White
};
like image 125
eestein Avatar answered Nov 09 '22 23:11

eestein