漸變色
- 設(shè)置顏色
self.navigationController.navigationBar.barTintColor = [UIColor orangeColor];
- 滾動視圖時(shí)設(shè)置透明度
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
self.navigationController.navigationBar.alpha = scrollView.contentOffset.y/100;
}
設(shè)置導(dǎo)航欄統(tǒng)一顏色
if ([UIDevice currentDevice].systemVersion.floatValue >= 7.0) {
[[UINavigationBar appearance] setBarTintColor:RGBACOLOR(78, 188, 211, 1)];
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:RGBACOLOR(245, 245, 245, 1), NSForegroundColorAttributeName, [UIFont systemFontOfSize:20.0], NSFontAttributeName, nil]];
}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者