您的位置:首页 > 移动开发 > IOS开发

设置bar的颜色,setTinColor&setBarTintColor

2013-12-16 13:49 579 查看
在ios7.0中setTinColor不能改变它的背景色,而要用setBarTintColor

/*
The behavior of tintColor for bars has changed on iOS 7.0. It no longer affects the bar's background
and behaves as described for the tintColor property added to UIView.
To tint the bar's background, please use -barTintColor.
*/
if (LY_IOS_VERSION<7.0) {
[self.navBar setTintColor:[UIColor blackColor]];
}
else
{
// [self.navBar setTintColor:[UIColor colorWithRed:161/255.0 green:232/255.0 blue:1.0 alpha:1.0]];
[self.navBar setBarTintColor:[UIColor redColor]];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios7