In my Xamarin.Forms 4.4 project, I had defined the global colors for my navigation bar to be a solid orange with white text using the following code::
UINavigationBar.Appearance.BackgroundColor = UIColor.Orange;
UINavigationBar.Appearance.BarTintColor = UIColor.Orange;
UINavigationBar.Appearance.TintColor = UIColor.White;
UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes()
{
ForegroundColor = UIColor.White
};
Since upgrading my Xamarin.Forms NuGet package from 4.4 to 4.5, any app I run in iOS 13 has a solid white navigation bar in Light Mode with white text.
I know that there are some new classes to use for iOS 13. But, I don't understand is how to use these to get the same appearance, (or just something readable) in iOS 13. Here is what I have tried:
UINavigationBarApperance nba = new UINavigationBarAppearance();
nba.ConfigureWithOpaqueBackground();
nba.BackgroundColor = UIColor.Orange;
nba.BarTintColor = UIColor.Orange;
nba.TintColor = UIColor.White;
UINavigationBar.Appearance.ScrollEdgeAppearance = nab;
UINavigationBar.Appearance.StandardAppearance = nab;
UINavigationBar.Appearance.CompactAppearance = nab;
Here are my results:
I can actually see some color bleeding through what appears to be a white gradient overlay. I suspect the dark grey is a result of a dark gradient over my chosen color
I have tried with shared code , there is no problem in my local site no mattter in Xamarin.iOS or Xamarin.Forms project .Effect as follow :
Using shared code need to write in
AppDelegate.cs
.If writing in other place ,such as in Sub-ViewController, will not work .In addition , from shared screenshot , the color has been setted for NavigationBar . However , it was overrided with other color .I think there are somewhere code written affects this .
By the way , there are methods of Xamarin Forms to set color for Navigation Bar . You also can use this or check whether already uesd it in project .
App.xaml.cs :