2016-07-11 152 views
0

我正在使用Objective-C。在這裏,我需要更改UINavigationBar的背景顏色。我試過下面這段代碼:更改UINavigationBar的顏色

self.navigationController.navigationBar.backgroundColor = [UIColor greenColor]; 

但結果是:

enter image description here

我要的是改變導航欄的顏色爲綠色下方,而不是模糊的綠色,因爲它就是現在。有人請幫助我。

回答

0

嘗試使用外觀

[[UINavigationBar appearance] setBarTintColor:[UIColor greenColor]]; 
[[UINavigationBar appearance] setTintColor:[UIColor greenColor]]; 

希望這有助於

2

確實喜歡選擇Naigation Bar的故事板和督察改變吧色調的財產直接

enter image description here

1

剛加入此代碼

self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 
相關問題