iOS之改变BarButtonItem中显示的字体大小
2015-10-17 09:49
337 查看
还是直接上代码吧。
UIButton * button_back = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44.0f, 44.0f)]; [button_back setCenter:CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2)]; [button_back.layer setCornerRadius:4.0f]; [button_back.layer setBorderColor:[UIColor blackColor].CGColor]; [button_back.layer setBorderWidth:1.0f]; [button_back setTitle:@"back" forState:UIControlStateNormal]; [button_back setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; [button_back.titleLabel setTextAlignment:NSTextAlignmentCenter]; [button_back addTarget:self action:@selector(backButtonClick:) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithCustomView:button_back]; [backButton setStyle:UIBarButtonItemStyleDone]; [self.navigationItem setLeftBarButtonItem:backButton];
相关文章推荐
- iOS之去掉NavigationBar 底部的黑线
- Quartz2D简介
- iOS_自定义Button
- #在蓝懿学习iOSd的日子#
- 傻瓜式操作Nagios
- iOS开发——Handoff详解
- IOS正则表达式,很详细,值得一看!
- IOS - TableView上拉刷新数据后设置显示偏移(新数据置顶)
- 音乐/音效之工具类的封装
- iOS开发之多线程编程:GCD
- iOS:核心动画之转场动画CATransition
- IOS 同步操作 通信
- iOS:核心动画之动画组CAAnimationGroup
- IOS应用接iOS聚合支付(SDK集成说明)
- iOS 页面间几种传值方式(属性,代理,block,单例,通知)
- 整理iOS9适配中出现的坑(图文)
- iOS:核心动画之关键帧动画CAKeyframeAnimation
- ios申请真机调试( xcode 5)详细解析
- ios-数字格式化
- IOS开源项目指标