Transparent UINavigationBar in Swift

后端 未结 6 972
感动是毒
感动是毒 2020-12-13 06:43

I am trying to make my UINavigationBar in UINavigationController transparent. I created a subclass of UINavigationController and liked

6条回答
  •  伪装坚强ぢ
    2020-12-13 07:05

    Xcode 8.x : Swift 3: Extension for the same Write once use throughout

    extension UINavigationBar {
    
        func transparentNavigationBar() {
            self.setBackgroundImage(UIImage(), for: .default)
            self.shadowImage = UIImage()
            self.isTranslucent = true
        }
    } 
    

提交回复
热议问题