Ios 15 Navigation Bar Transparent

iOS 15 Navigation Bar issue

Preview Image

Change alpha from 0 to 1 on your backgroundColor property

func customNavigationBar() {
let coloredAppearance = UINavigationBarAppearance()
coloredAppearance.configureWithTransparentBackground()
coloredAppearance.backgroundColor = UIColor(
red: 41/255,
green: 59/255,
blue: 77/255,
alpha: 1) //alpha: 0 is Transparent and alpha: 1 is colored
coloredAppearance.shadowColor = .clear
coloredAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
coloredAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]

UINavigationBar.appearance().standardAppearance = coloredAppearance
UINavigationBar.appearance().compactAppearance = coloredAppearance
UINavigationBar.appearance().scrollEdgeAppearance = coloredAppearance
UINavigationBar.appearance().tintColor = .white
}

Making status bar opaque on iOS = 15

its impossible to make status bar opaque (and colorized) while navigation controller is hidden (not visible) on iOS >= 15?

This has nothing to do with iOS 15. There is nothing new in iOS 15 affecting the status bar. The status bar has been transparent for something like 6 or 7 years now. (I don't have time to figure out when this change happened; the point is, it's ancient history.) There is no such thing as an opaque and/or colorized status bar, and there hasn't been for all that time. The navigation bar transparency / opacity does not affect the status bar transparency in any way. If the status bar shows the navigation bar behind it, fine; you seem to like that. If you don't like the color of what's behind the status bar when the navigation bar is hidden or transparent, change whatever's visible behind the status bar.

Change current colour of NavigationBar in iOS15

the NavBar current-colour change based on user input while the app is running(after application(didFinisLaunching) has been called) is not working

You cannot change a navigation bar color while that navigation bar is showing by using the appearance proxy. The appearance proxy affects only future interface elements. You need to apply your UINavigationBarAppearance to the existing navigation bar directly:

self.navigationController?.navigationBar.standardAppearance = appearance
self.navigationController?.navigationBar.scrollEdgeAppearance = appearance


Related Topics



Leave a reply



Submit