标签:
一,各种名称和位置
//技巧一键换肤
[[UINavigationBar appearance]setBarTintColor:[UIColor redColor]];//给所有的NavigationBar换颜色
[[UITabBar appearance]setBarTintColor:[UIColor blueColor]];//给所有的TabBar换颜色
二,UINavigationBar:
1,设置导航条透明度:self.navigationBar.translucent = NO;
2,设置Bar背景颜色:self.navigationBar.barTintColor = [UIColour RedColour];->The tint color to apply to the navigation bar background.修改bar的背景颜色
3,设置navigation items和bar button items颜色:self.navigationBar.tint = [UIColour BlurColour];->The tint color to apply to the navigation items and bar button items.修改navigation items和bar button items;
4,设置返回箭头的自定义图片//imageWithRenderingMode 图片的显示模式,要设置成originnal图片的颜色才会变成自定义的图片颜色,否则默认系统颜色。
UIImage *backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];//注意下面两个属性都要设置,只设置一个是无效的。
[UINavigationBar appearance]setBackIndicatorTransitionMaskImage:backimage];
[UINavigationBar appearance]setBackIndicatorImage:backimage];
5,去掉导航栏的文字,钻了空子,设置了文字的PositionAdjustment就可以了:
UIBarButtonItem baritem = [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class],nil];
UIOffset offset;
offset.horizontal = -500;
[baritem setBackButtonTitlePositionAdjustment:offset forBarMetrics:UIBarMetricsDefault];
6,导航栏文字的设置.
//返回按钮字体设置
[baritem setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} forState:UIControlStateNormal];
//改变导航的title样式
NSDictionary *TitleAttributes = [NSDictonary dictionaryWithObjectsAndKeys:Nav_title_Colour,NSForegroundcolourAttributeName,Nav_Titlefont,NSfontAttributeName,nil];
[[UINavigationBar appearance]setTitleTextAttributes:titleAttributes];
UIToolBar:(UITabbar的位置,工具条)
UITabBarController+UINavigationController+UIToolBar
标签:
原文地址:http://www.cnblogs.com/yangqinglong/p/5574303.html