I have been attempting to change my Toolbars and was capable of lastly getting work with somebody’s assist right here on the UINavigationBar
. Nonetheless I attempted to use related method to UITabBarAppearance
however I see no modifications. I see no errors or warnings, I additionally tried altering its shade particularly for my part with OnApear
and noticed no distinction.
import SwiftUI
@most important
struct ElementApp: App {
init() {
// Customise UINavigationBar
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.backgroundEffect = UIBlurEffect(fashion: .systemUltraThinMaterial)
navBarAppearance.backgroundColor = UIColor.black.withAlphaComponent(0.7)
navBarAppearance.shadowColor = .clear
UINavigationBar.look().standardAppearance = navBarAppearance
UINavigationBar.look().compactAppearance = navBarAppearance
UINavigationBar.look().scrollEdgeAppearance = navBarAppearance
// Customise UITabBar
let tabBarAppearance = UITabBarAppearance()
tabBarAppearance.backgroundEffect = UIBlurEffect(fashion: .systemUltraThinMaterial)
tabBarAppearance.backgroundColor = UIColor.black.withAlphaComponent(0.7)
tabBarAppearance.shadowColor = .clear
UITabBar.look().standardAppearance = tabBarAppearance
UITabBar.look().scrollEdgeAppearance = tabBarAppearance
}
var physique: some Scene {
WindowGroup {
ContentView()
}
}
}