首页 > 移动平台 > 详细

ios-Nav右上角按钮

时间:2014-09-22 12:02:03      阅读:316      评论:0      收藏:0      [点我收藏+]

右上角的设置按钮

bubuko.com,布布扣
1 //******************  右上角保存按钮  ******************
2         UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
3         [rightBtn setBackgroundImage:[UIImage imageNamed:@"xiesixin.png"] forState:UIControlStateNormal];
4         [rightBtn setFrame:CGRectMake(0, 0, 50, 30)];
5         [rightBtn setTitle:@"保存" forState:UIControlStateNormal];
6         [rightBtn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside ];
7         UIBarButtonItem *searchButton = [[UIBarButtonItem alloc]initWithCustomView:rightBtn];
8         self.navigationItem.rightBarButtonItem = searchButton;
9         self.tabBarController.hidesBottomBarWhenPushed = YES;
View Code

ms用的不是自定义NavgationController,所以需要使用到 UIBarButtonItem 来设置。

ios-Nav右上角按钮

原文:http://www.cnblogs.com/xm5mao/p/3985693.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!