傳統的設置ios
if (IOSVERSION >= 7) { [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]]; } else { [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]]
]; }
在ios6下顯示正常,可是在ios7下顏色卻看起來有點失真!!!app
那是由於ios坑爹的加了translucent屬性也就是半透明,我能夠很負責人的說,你怎麼設置都不起效,坑爹的模糊效果.spa
正確的姿式:code
[[UINavigationBar appearance] setBackgroundImage:[UIColor redColor] forBarMetrics:UIBarMetricsDefault];
簡單的功能更見基礎的重要!blog