Temporarily record a small knowledge point, because rush to do the project, follow-up will slowly add
Self.navigationItem.leftBarButtonItem = [[Uibarbuttonitem alloc]initwithtitle:@ ' side bar ' style: Uibarbuttonitemstyleplain target:self Action: @selector (Clickleftbutton:)];
If we use this line of code to define a button, regardless of the left-hand side, the picture or the text, he will change the font or picture color to the default blue, but not our needs,
All of us like this
UIButton *rightbtn = [UIButton buttonwithtype:uibuttontypecustom];
[Rightbtn setimage:[uiimage imagenamed:@ "Collect1"] forstate:uicontrolstatenormal];
Rightbtn.frame = CGRectMake (0, 0, 30, 30);
[Rightbtn addtarget:self Action: @selector (collection:) forcontrolevents:uicontroleventtouchupinside];
Uibarbuttonitem *rightbaritem = [[Uibarbuttonitem alloc]initwithcustomview:rightbtn];
Self.navigationItem.rightBarButtonItem = Rightbaritem;
The custom button as the navigation bar button, the focus is the red mark, we need to set the button type to custom instead of the system, so that our button picture color is the original color, if it is text, color can be set under their own, and will not be the default blue ~
IOS Notes-Custom navigation bar buttons