自定义导航栏的返回按钮
2015-08-20 15:08
288 查看
/*
获取左侧导航栏按钮
*/
- (void)customBackItems{
UIButton *button = [UIButton
buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage
imageNamed:@"Left_arrow"]
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(callModalList)
forControlEvents:UIControlEventTouchUpInside];
button.frame =
CGRectMake(5,
5, 36,
36);
UIBarButtonItem *leftButton = [[UIBarButtonItem
alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = leftButton;
}
/*
导航栏后退
*/
- (void)callModalList{
NSLog(@"点击了左侧按钮");
[self.navigationController
popViewControllerAnimated:YES];
}
获取左侧导航栏按钮
*/
- (void)customBackItems{
UIButton *button = [UIButton
buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage
imageNamed:@"Left_arrow"]
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(callModalList)
forControlEvents:UIControlEventTouchUpInside];
button.frame =
CGRectMake(5,
5, 36,
36);
UIBarButtonItem *leftButton = [[UIBarButtonItem
alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = leftButton;
}
/*
导航栏后退
*/
- (void)callModalList{
NSLog(@"点击了左侧按钮");
[self.navigationController
popViewControllerAnimated:YES];
}
相关文章推荐
- 处理并发
- Dom元素的属性-卓有成效的使用
- DB2创建序列
- Android Call requires API level 11 (current min is 8)的解决方案
- Oracle基本查询 二
- jQuery+HTML5加入购物车代码分享
- Oracle\PLSQL Developer报“动态执行表不可访问,本会话的自动统计被禁止”的解决方案
- C#模拟PrtScn实现截屏
- [转载文章] 检测php网站是否已经被攻破的方法
- POJ-2676-Sudoku-DFS
- iOS系统网络抓包方法
- C#模拟PrtScn实现截屏
- SVN不错的入门
- Programming in Lua读书笔记
- iOS 访问粘贴板
- Android(java)学习笔记182:Android读写数据到SD卡中
- setInterval()和setTimeout()
- Maven学习总结(九)——使用Nexus搭建Maven私服
- Eclipse 一直提示 loading descriptor for xxx 的解决方法
- webService学习记录-关于web项目配置的几点说明