Reputation: 228
I've to make my navigation bar transparent, I tried with this code :
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.view.backgroundColor = UIColor.clear
But my navigation bar become white, I don't understand the reason! Can someone help to solve this problem?
Upvotes: 0
Views: 296
Reputation: 12144
You are doing right way to make transparent UINavigationBar
but seem like you have a wrong constraint. Make sure you top constraint of your scrollView
is equal to Superview.Top
.
If your top constraint of your scrollView
is equal to Safe Area.Top
, of course your ScrollView
won't scroll below UINavigationBar
.
Upvotes: 1