Typically, translucent UINavigationBar
s have a light gray color above a white background.
However, many navigation bars throughout iOS 11 have a white color.
For example, navigation bars in the Files app are white AND translucent which are noticeably different from setting barTintColor
to white.
How do I achieve this kind of effect on a UINavigationBar
?
barTintColor
of the navigation bar to white.After that, subclass UINavigationBar
and set the shadow image to an empty UIImage
.
class CustomNavBar: UINavigationBar { override func awakeFromNib() { super.awakeFromNib() shadowImage = UIImage() } }
Finally, set the class of the navigation bar to the custom navigation bar class you just created.
Result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With