If your app changed the color of navigation bar (background / foreground / text color / tint color), it is probably broken in the new iOS 15. Here is how I fix them in Xamarin:
if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
{
// change the background and text color of title bar
var appearance = new UINavigationBarAppearance();
appearance.ConfigureWithOpaqueBackground();
appearance.BackgroundColor = CustomColor.AccentColor;
appearance.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = CustomColor.ForegroundColor };
appearance.LargeTitleTextAttributes = new UIStringAttributes() { ForegroundColor = CustomColor.ForegroundColor };
UINavigationBar.Appearance.StandardAppearance = appearance;
UINavigationBar.Appearance.ScrollEdgeAppearance = appearance;
}
else
{
// change the background color of title bar
UINavigationBar.Appearance.BarTintColor = CustomColor.AccentColor;
UINavigationBar.Appearance.Translucent = false;
// change the title text color
UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = CustomColor.ForegroundColor };
}
// change the button color on navigation bar
UINavigationBar.Appearance.TintColor = CustomColor.ForegroundColor;
I am trying this code in iOS 15 but its not working.
LikeLike
FYI, the solution is written in C# / Xamarin iOS. If you are using native iOS / Swift / Objective-C, you need to manually convert the code.
LikeLike