Real time blur effect for Navigation Bar

后端 未结 9 2306
不思量自难忘°
不思量自难忘° 2020-11-28 05:21

How to achieve the real time blurring effect for the navigation bar just like the Trailers app in iPhone.

i.e As you scroll the contents should get blurred behind th

9条回答
  •  情歌与酒
    2020-11-28 06:24

    I first added addBlurEffect() method and then in AppDelegate, I added

     UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)
    
     UINavigationBar.appearance().shadowImage = UIImage()
    
     UINavigationBar.appearance().backgroundColor = UIColor.clearColor()
    
     UINavigationBar.appearance().translucent = true
    

    Now it works for me

提交回复
热议问题