修改導航欄按鈕的左右frame字體大小顏色(彈簧)

-(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];

}

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容