Xamarin iOS: UITabBarController BarTintColor not working in iOS 15

Wong Wei Loon 11 Reputation points

I came across a similar issue in this post.

I have a tab bar renderer class for iOS, in ViewWillAppear(), I use code TabBar.BarTintColor = UIColor.Blue to change tab bar color, it works only for iOS below than iOS15 but not in iOS15.

I tried to convert UINavigationBar ( iOS code ) into UITabBar (Xamarin.iOS C#).

iOS Native Code:

let appearance = UINavigationBarAppearance()
appearance.backgroundColor = <your tint color>
navigationBar.standardAppearance = appearance;
navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance

my own code for Xamarin.iOS C#

if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
    var appearance = new UITabBarAppearance();
    appearance.BackgroundColor = UIColor.Blue;
    this.TabBarController.TabBar.StandardAppearance = appearance;
     TabBar.BarTintColor = UIColor.FromRGB((float)rgbColorBackground.R, (float)rgbColorBackground.G, (float)rgbColorBackground.B);

However, there is no reference to "scrollEdgeAppearance" in UITabBar class Xamarin.iOS C#, and it seems important to add this to solve the issue. I'd be grateful if someone can give me some advice or point out my mistakes.

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,010 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto A 6 Reputation points

    I added only this line and it fixed it
    public override bool FinishedLaunching(UIApplication app, NSDictionary options){
    UITabBar.Appearance.BackgroundColor = UIColor.Black;}

    That fixed it and looks like it used to look <15

    1 person found this answer helpful.
    0 comments No comments