修改nav返回按钮样式,并且设施返…
2016-04-09 13:57
489 查看
#pragma mark 返回文字置空
- (void)viewWillAppear:(BOOL)animated
{
[super
viewWillAppear:animated];
self.navigationController.navigationBar.barTintColor
=
customColor(42,45,58);
self.navigationController.navigationBar.hidden
=
NO;
UIButton
*
button = [UIButton
buttonWithType:UIButtonTypeCustom];
button.frame
= CGRectMake(0,
5,
25,
25);
[button setImage:[UIImage
imageNamed:@"nav_icon"]
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(buttonClick)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem
* buttonItem = [[UIBarButtonItem
alloc]
initWithCustomView:button];
self.navigationItem.leftBarButtonItem
=
buttonItem;
}
- (void)buttonClick
{
[self.navigationController
popViewControllerAnimated:YES];
self.navigationController.navigationBar.alpha
=
1;
}
- (void)viewWillAppear:(BOOL)animated
{
[super
viewWillAppear:animated];
self.navigationController.navigationBar.barTintColor
=
customColor(42,45,58);
self.navigationController.navigationBar.hidden
=
NO;
UIButton
*
button = [UIButton
buttonWithType:UIButtonTypeCustom];
button.frame
= CGRectMake(0,
5,
25,
25);
[button setImage:[UIImage
imageNamed:@"nav_icon"]
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(buttonClick)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem
* buttonItem = [[UIBarButtonItem
alloc]
initWithCustomView:button];
self.navigationItem.leftBarButtonItem
=
buttonItem;
}
- (void)buttonClick
{
[self.navigationController
popViewControllerAnimated:YES];
self.navigationController.navigationBar.alpha
=
1;
}
相关文章推荐
- HTML/CSS学习笔记
- <css二>text
- CSS框模型_内边距&边框&外边距
- <css 一>background
- 收集的各种css reset方法总有一款是适合你的
- 纯CSS实现各类气球泡泡对话框效果
- PS图层样式制作3D立体金属吊坠
- CSS样式_表格&轮廓
- CSS实现垂直居中的常用方法
- html(第一天,div+css)
- css中的选择器
- Css 基础
- CSS初学者到高手成长之路
- css3:背景属性background-origin/clip详解
- CSS3:background-size背景图片尺寸属性
- 详细讲解transform,一看就懂了!(转)
- 纯css3点击切换图片-纯css3点击切换图标
- css清除浮动
- CSS3 @keyframe动画的基本用法与常见错误用法
- 基础DOM和CSS操作