UITabBar.appearance().isTranslucent = false
I can do this thing in swiftui controller’s init method, but I want to use swiftui code to perform the same action, instead of UIKit code.
UITabBar.appearance().isTranslucent = false
I can do this thing in swiftui controller’s init method, but I want to use swiftui code to perform the same action, instead of UIKit code.
2
Answers
you could do a custom tabbar and customize anything you want
First: Create the model
Second: Apply tab bar
now the tab bar style is transparent thanks to
ultraThinMaterial
From iOS 16 this can be done with:
Additionally set the color with
.toolbarBackground(.gray, for: .tabBar)
.Group
is not needed, but it would put.toolbarBackground()
below one of the tab items, which looks horrible. (It must be placed inside theTabView
block.)