IOS 一个继承UINavigationController的子类
来源:互联网 发布:如何做好酒店网络销售 编辑:程序博客网 时间:2024/06/05 07:56
#import <UIKit/UIKit.h>@interface BasicNavigationController : UINavigationController@end
#import "BasicNavigationController.h"@interface BasicNavigationController ()@end@implementation BasicNavigationController- (void)viewDidLoad { [super viewDidLoad]; // 1.appearance方法返回一个导航栏的外观对象 // 修改了这个外观对象,相当于修改了整个项目中的外观 UINavigationBar *bar = [UINavigationBar appearance]; // 2.设置导航栏的背景图片 //2.1修改导航栏系统返回箭头图片 bar.backIndicatorImage = [UIImage imageNamed:@"nav_backItem_white"]; bar.backIndicatorTransitionMaskImage = [UIImage imageNamed:@"nav_backItem_white"]; //2.2设置shadowImage [bar setBarStyle:UIBarStyleBlackTranslucent]; bar.shadowImage = [[UIImage alloc] init]; //2.3设置导航栏颜色 [bar setTintColor:[UIColor whiteColor]]; [bar setBarTintColor:KGlobalBlueColor]; // 3.设置导航栏文字的主题 [bar setTitleTextAttributes:@{ NSFontAttributeName : KFontHeadline, NSForegroundColorAttributeName : [UIColor whiteColor] }]; // 4.修改所有UIBarButtonItem的外观 UIBarButtonItem *barItem = [UIBarButtonItem appearance]; //4.1设置返回不需要文字 //注:添加此方法,切换应用会出现一闪// [barItem setBackButtonTitlePositionAdjustment:UIOffsetMake(NSIntegerMin, NSIntegerMin) forBarMetrics:UIBarMetricsDefault]; // 5.修改item上面的文字样式 NSDictionary *dict = @{ NSFontAttributeName: KFontSubhead, NSForegroundColorAttributeName : [UIColor whiteColor] }; NSDictionary *dictEnable = @{ NSFontAttributeName: KFontSubhead, NSForegroundColorAttributeName: KGreyColor, }; [barItem setTitleTextAttributes:dict forState:UIControlStateNormal]; [barItem setTitleTextAttributes:dict forState:UIControlStateHighlighted]; [barItem setTitleTextAttributes:dictEnable forState:UIControlStateDisabled];}@end
1 0
- IOS 一个继承UINavigationController的子类
- IOS 一个继承UITabBarController的子类(UIImageRenderingMode)
- 子类继承父类的一个问题
- 继承UINavigationController的问题----UITabBarController
- IOS的UINavigationController使用
- Hibernate继承映射--每个子类一个数据表的实现案例
- 一个简单的子类继承父类私有方法代码
- 子类的继承
- 子类的继承性
- 子类继承父类,new 一个子类对象的过程(待完善)
- C++子类继承父类后子类的大小
- IOS之【UINavigationController的使用】
- iOS --- UINavigationController的简单总结
- iOS之UINavigationController的使用
- iOS-UINavigationController的学习
- iOS:UINavigationController的常用属性
- iOS之UINavigationController的使用
- c++ 继承子类的sizeof
- POJ 3279 二进制搜索
- Android之XML解析应用
- Linux的LCD驱动
- Java I/O流
- 【打表计划】【小澳的坐标系】 矩阵快速幂
- IOS 一个继承UINavigationController的子类
- 总结29
- 二叉树的遍历(加深自己的印象)
- Intellij利用Maven创建多Module的Java Web项目
- String(第一篇博客)
- LightOJ-1064-dp
- BZOJ 1008 [HNOI2008] 越狱
- 错题集
- Android之反射机制与JSON解析