在iOS 7中,導航欄對於在下面滾動的內容具有模糊效果。我想我的導航欄是透明的,這是實現這樣的:透明導航欄,但保持iOS模糊
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
[[UINavigationBar appearance] setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[UIImage new]];
[[UINavigationBar appearance] setBackgroundColor:[UIColor clearColor]];
但我希望內容也模糊。我嘗試了以下運氣:
[[UINavigationBar appearance] setBarTintColor:[UIColor clearColor]];
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault];
[[UINavigationBar appearance] setShadowImage:[UIImage new]];
[[UINavigationBar appearance] setBackgroundColor:[UIColor clearColor]];
相反,這會使導航欄模糊內容視圖,但是是黑色的。如果我刪除了setBarTintColor
,導航欄會模糊內容,但它是白色的。我嘗試了各種其他組合,但導航欄不是白色就是黑色。
我看過幾個SO問題,但他們不幫我。他們回答如何得到一個completely transparent navbar或get a certain colour,當我想要的是它是清晰/透明的,沒有任何一種顏色色調。
我該怎麼做到這一點?感謝您的幫助,非常感謝!