UINavigationController 总结
2015-11-08 21:06
447 查看
一 . UINavigationBar
1.获取 UINavigationBar 对象: [UINavigationBar appearance] ,可以通过该方法对全部 navigation 进行设置
2.设置导航栏背景图片:[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"name"] forBarMetrics:UIBarMetricsDefault];
3.设置标题字体:[UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
二 . UIBarButtonItem
1.获取 UIBarButtonItem 对象: [UIBarButtonItem appearance] 可以通过该方法实现对 barButtonItem (即导航栏按钮)样式,显示字体进行设置 (同一 navigation 下全部)
2.设置按钮的颜色,大小 : [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:13]} forState:UIControlStateNormal];
3.设置导航栏渐变色(返回箭头白色) : [UIBarButtonItem appearance].tintColor = [UIColor whiteColor];
1.获取 UINavigationBar 对象: [UINavigationBar appearance] ,可以通过该方法对全部 navigation 进行设置
2.设置导航栏背景图片:[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"name"] forBarMetrics:UIBarMetricsDefault];
3.设置标题字体:[UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
二 . UIBarButtonItem
1.获取 UIBarButtonItem 对象: [UIBarButtonItem appearance] 可以通过该方法实现对 barButtonItem (即导航栏按钮)样式,显示字体进行设置 (同一 navigation 下全部)
2.设置按钮的颜色,大小 : [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:13]} forState:UIControlStateNormal];
3.设置导航栏渐变色(返回箭头白色) : [UIBarButtonItem appearance].tintColor = [UIColor whiteColor];
相关文章推荐
- __builtin_expect 解惑
- lightoj Answering Queries 1369 (数学转换&&技巧)
- HDU 1560DNA sequence
- 使用VS2010调用QtDesigner设计的UI文件,并实现控件功能
- EasyUI - 后台管理系统 - 增加,删除,修改
- IOS UISwitch 感觉官方提供的拓展性不够好,老感觉这个东西项目中用到需要自己定制
- UITableView 滑动自动加载更多数据
- Gson 解析 json中 value为数组
- Light OJ 1369 - Answering Queries 【规律】
- 快速排序
- Adreno Profiler GPU frequency clocks per/second
- 【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest F】【贪心+ STL-优先队列】 Gourmet and Banquet 最大活动时间
- UIGestureRecognizer(进阶)
- UIFont中fontName大全
- iOS之UILabel显示内容自动换行
- ios开发-UIImageView的使用,点击图片刷新对应数据的过程
- 设置IIS7文件上传的最大大小 maxAllowedContentLength,maxRequestLength
- 1369 - Answering Queries
- ios开发-UISlider通过滑动添加单元格功能
- java parseint 和 Integer.value