美文网首页
修改导航栏按钮的左右frame字体大小颜色(弹簧)

修改导航栏按钮的左右frame字体大小颜色(弹簧)

作者: 蔡林林 | 来源:发表于2016-08-15 15:01 被阅读70次

-(void)creatNaviUI{

self.navigationItem.title =@"余额";

//修改导航栏标题字体大小和颜色

[self.navigationController.navigationBar setTitleTextAttributes:

@{NSFontAttributeName:[UIFont systemFontOfSize:20],

NSForegroundColorAttributeName:[UIColor blackColor]}];

self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc]initWithTitle:@"提现规则" style:UIBarButtonItemStyleDone target:self action:@selector(rightBtn:)];

//左侧修改系统按钮的左右坐标

UIButton *btnTitle =[[UIButton alloc]initWithFrame:CGRectMake(-30, 10, 120, 30)];

[btnTitle addTarget:self action:@selector(leftBtn:) forControlEvents:UIControlEventTouchUpInside];

[btnTitle setTitle:@"我的钱包" forState:UIControlStateNormal];

[btnTitle setImage:[UIImage imageNamed:@"back_bt_7"] forState:UIControlStateNormal];

[btnTitle setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];

UIBarButtonItem *btnBack3 =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:@selector(leftBtn:)];

btnBack3.width =-20;

self.navigationItem.leftBarButtonItems =@[btnBack3,[[UIBarButtonItem alloc]initWithCustomView:btnTitle]];

}

-(void)leftBtn:(UIButton *)btn{

NSLog(@"返回。。");

[self.navigationController popViewControllerAnimated:YES];

}

相关文章

网友评论

      本文标题:修改导航栏按钮的左右frame字体大小颜色(弹簧)

      本文链接:https://www.haomeiwen.com/subject/gpuusttx.html