Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set color `rightBarButtonItem` on navigation bar?

I want to set color of "Done" button on navigation bar like this image:

enter image description here

Although, I've set code as self.doneButton.enabled = NO; but Done button still has a white color. It does not change color like image.

How to set the code to change text color done button like Done button in the image above? Please help me to solve this problem. I appreciate your help.

like image 885
Cuong Nguyen Avatar asked Aug 10 '16 04:08

Cuong Nguyen


1 Answers

Try This

UIBarButtonItem *rightBarButton=[[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStylePlain target:self action:@selector(editProfileClick)];
rightBarButton.tintColor=[UIColor whiteColor];
self.navigationItem.rightBarButtonItem = rightBarButton;


-(void)editProfileClick
{
//your methods
}
like image 119
Dishant Rajput Avatar answered Nov 15 '22 23:11

Dishant Rajput