swift – iOS 15 Navigation bar shade change dynamically

[ad_1]

I am attempting to vary the navigationbar shade dynamically. However the issue is that except I scroll to the highest solely the the brand new shade is seen in any other case the previous shade is seen. I am utilizing the under code to set the colour. My requirement is that if I alter the colour I need the navigation bar to point out the brand new shade no matter the scrolling. I might actually admire your recommendations.

`let navigationBarAppearance = UINavigationBarAppearance()
 UINavigationBar.look().standardAppearance = navigationBarAppearance
 UINavigationBar.look().compactAppearance = navigationBarAppearance
 UINavigationBar.look().scrollEdgeAppearance = navigationBarAppearance
 navigationBarAppearance.backgroundColor = .purple`

I’ve tried the code thats been particularly given for iOS 15 and later

[ad_2]

Leave a Reply