2014-09-29 79 views
0

enter image description here刪除導航欄陰影iPhone 6/6plus上的顏色

我試圖刪除這個白色筆畫。我之前已經修復了這個問題使用

[self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]]; 

它在iPhone 4s,5,5s和iOS 7/8上完美工作。但出於某種原因,iPhone 6/6 +仍然存在陰影。 我也試過這個沒有結果。它只是使陰影顏色比我目前的navBar bgColour(白色:0 alpha 0.9)更深。

UIView * bgView = [[UIView alloc] initWithFrame:CGRectMake(0, self.navigationController.navigationBar.height, self.navigationController.navigationBar.width, 1)]; 
bgView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.9]; 
[self.navigationController.navigationBar addSubview:bgView]; 
[self.navigationController.navigationBar setShadowImage:nil]; 

任何想法?

回答

0

試着做下面的事情,這至少適用於我。

[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]]; 
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; 

我也選擇自定義顏色

[[UINavigationBar appearance] setBarTintColor:[UIColor XXXXXX]]; 
0

嘗試設置導航的酒吧財產clipsToBounds爲YES