Transparent TabBar

Has anybody managed to have a fully transparent TabBar in iOS? I don’t get it done, not even with @Jeremie_L iOSExtensions.

Can you show a screenshot of the current result?

Hi Jeremie, sorry for my late reply. Seems it wasn’t too important to me :wink:

This is the code I’m using:

self.SetTabBarColorXC(cgrBlack, false)
self.SetTabBarButtonColorXC(cgrYellow)

cgrBlack is a color group with a single color: #000000 and 100% opacity
cgrYellow is a color group with a single color: #F3BC18 and 100% opacity

And it seems it’s transparent on newer iOS versions, though it’s not what I would expect with this code. Here are a few simulator pictures with the same code from above:

iPhone 8, iOS 13.0
Bildschirmfoto 2022-01-23 um 20.34.30

iPhone 11 Pro, iOS 13.0
Bildschirmfoto 2022-01-23 um 20.37.04

iPhone 11, iOS 14.1
Bildschirmfoto 2022-01-23 um 20.39.15

iPhone 8, iOS 15.0
Bildschirmfoto 2022-01-23 um 20.41.56

iPhone 13 Pro, iOS 15.0
Bildschirmfoto 2022-01-23 um 20.32.45

All the versions except for 15.0 show the black tabbar as expected. Not sure why iOS 15.0 shows it transparent. Anyway, I’m changing the code to this (where cgrTransparent is a color group with 0% opacity) to have the tabbar transparent in all iOS versions:

self.SetTabBarColorXC(cgrTransparent, false)
self.SetTabBarButtonColorXC(cgrYellow)

There’s no change in the tabbar color, it’s the same as above: up until 15.0 it’s black, then it’s transparent.

To summarize: it seems in iOS 15.0 the tabbar is transparent no matter the color I’m setting as the TabBarColor. For all the earlier versions, it seems the tabbar is not transparent, regardless of the color. If you want to investigate further, I can send you more screens.

I had a similar problem with the navigation bar and iOS 15. So, I suppose that with the tab bar it might be the same. In iOS 15 the bar is transparent by default. To restore the old look, it is required to adopt the new UINavigationBar appearance APIs.

This was the solution in Objective-C:

if (@available(iOS 15, *)){
        UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
        [appearance configureWithOpaqueBackground];
        appearance.titleTextAttributes = @{NSForegroundColorAttributeName : UIColor.whiteColor};
        appearance.backgroundColor = [UIColor colorWithRed:0.0/255.0 green:125/255.0 blue:0.0/255.0 alpha:1.0];
        [UINavigationBar appearance].standardAppearance = appearance;
        [UINavigationBar appearance].scrollEdgeAppearance = appearance;
    }

So, maybe something similar will be required also in Xojo for the tab bar.