您的位置:首页 > Web前端 > CSS

修改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;

 

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: