自定义导航栏
一、全局宏定义
//系统版本号
#define SYS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
//颜色
#define UICOLORFROMRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
// 程序可用的rect
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
调用颜色设置的时候:UICOLORFROMRGB(0x05406c) 需要加上0x
二、在AppDelegate中 把主界面添加到导航之后 需把系统的导航栏隐藏 self.navigationController.navigationBarHidden = YES; 创建类别的时候 类继承 NavigatorViewController 在子类中可以自由重写导航的左右两边按钮事件 子类里面创建控件的轴坐标 需要从 self.validRect.origin.y 开始