navigationBar中左右Item
2016-03-22 00:00
330 查看
摘要: 自定义navigationBar左右Item的字体(大小)
/*
// 系统箭头样式
UIBarButtonSystemItemPlay
*/
UIBarButtonItem * rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(rightButton)];
self.navigationItem.rightBarButtonItem = rightBtn;
// right itme (变相让按钮靠右)
UIButton * rightItemButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 40)];
// 设置 宽高 (需倒入工具类)
//rightItemButton = CGSizeMake(100, 40);
/*
// 加上边框
[rightItemButton.layer setBorderWidth:1.0f];
// 圆角
[rightItemButton.layer setCornerRadius:4.0f];
// 边框颜色
[rightItemButton.layer setBorderColor:[UIColor blackColor].CGColor];
*/
[rightItemButton setTitle:@"下一步" forState:UIControlStateNormal];
// 字体大小
rightItemButton.titleLabel.font = [UIFont systemFontOfSize:20];
// 颜色
[rightItemButton setTitleColor:[UIColor colorWithRed:0.000 green:0.431 blue:0.427 alpha:1.000] forState:UIControlStateNormal];
// 居中
[rightItemButton.titleLabel setTextAlignment:NSTextAlignmentCenter];
// 添加点击事件
[rightItemButton addTarget:self action:@selector(backButtonClick:) forControlEvents:UIControlEventTouchUpInside];
// 第一次见
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithCustomView:rightItemButton];
// 状态 作用不明
//[rightButton setStyle:UIBarButtonItemStyleDone];
// 设置 右边time 为
[self.navigationItem setRightBarButtonItem:rightButton];
学自:http://www.cocoachina.com/bbs/read.php?tid-298084.html
/*
// 系统箭头样式
UIBarButtonSystemItemPlay
*/
UIBarButtonItem * rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(rightButton)];
self.navigationItem.rightBarButtonItem = rightBtn;
// right itme (变相让按钮靠右)
UIButton * rightItemButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 40)];
// 设置 宽高 (需倒入工具类)
//rightItemButton = CGSizeMake(100, 40);
/*
// 加上边框
[rightItemButton.layer setBorderWidth:1.0f];
// 圆角
[rightItemButton.layer setCornerRadius:4.0f];
// 边框颜色
[rightItemButton.layer setBorderColor:[UIColor blackColor].CGColor];
*/
[rightItemButton setTitle:@"下一步" forState:UIControlStateNormal];
// 字体大小
rightItemButton.titleLabel.font = [UIFont systemFontOfSize:20];
// 颜色
[rightItemButton setTitleColor:[UIColor colorWithRed:0.000 green:0.431 blue:0.427 alpha:1.000] forState:UIControlStateNormal];
// 居中
[rightItemButton.titleLabel setTextAlignment:NSTextAlignmentCenter];
// 添加点击事件
[rightItemButton addTarget:self action:@selector(backButtonClick:) forControlEvents:UIControlEventTouchUpInside];
// 第一次见
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithCustomView:rightItemButton];
// 状态 作用不明
//[rightButton setStyle:UIBarButtonItemStyleDone];
// 设置 右边time 为
[self.navigationItem setRightBarButtonItem:rightButton];
学自:http://www.cocoachina.com/bbs/read.php?tid-298084.html
相关文章推荐
- jQuery $.each用法
- jquery 的load()方法
- jQuery常用的方法
- Jquery中的append()和preappend(),after()和before()的区别
- node本地分享web服务
- iOS开发中打电话发短信等功能的实现
- IOS学习笔记—苹果推送机制APNs
- Mariadb集群搭建
- mysqldump导出的数据导入时特别慢的问题解决
- Android 进程常驻(0)----MarsDaemon使用说明
- Android 进程常驻(1)----开篇
- Android 进程常驻(2)----细数利用android系统机制的保活手段
- Android 进程常驻(3)----native保活5.0以下方案推演过程以及代码详述
- Android 进程常驻(4)----native保活5.0以上方案推演过程以及代码详述
- Android 进程常驻(5)----开机广播的简单守护以及总结
- Beaglebone Black教程使用SSH通过USB和因特网连接Beaglebone Blac
- 【2016.3.21】关于字符串的一点总结
- Android中使用Service时需要注意的几个问题
- tomcat添加gcc日志
- LBS基站定位接口代码示例