I want to set the background color of navigation bar to black, then all internal colors are white.
So, I used this code:
1 [[Uinavigationbar appearance] Settitletextattributes:2 [nsdictionary Dictionarywithobjectsandkeys:3 [Uicolor Whitecolor],4 Nsforegroundcolorattributename,5 [Uicolor Whitecolor],6 Nsforegroundcolorattributename,7[Nsvalue Valuewithuioffset:uioffsetmake (0, -1)],8 Nsforegroundcolorattributename,9[Uifont Fontwithname:@"Arial-bold"Size0.0],Ten Nsfontattributename, OneNil]];
However, the return button text color, arrow color, and navigation bar button color are still the default colors, how to modify them?
Workaround
Now, if you want to modify their colors, use the following code:
1 self.navigationController.navigationBar.barTintColor = [Uicolor blackcolor]; 2 self.navigationController.navigationBar.tintColor = [Uicolor whitecolor]; 3 [Self.navigationController.navigationBar settitletextattributes:@{nsforegroundcolorattributename: [Uicolor Whitecolor]}]; 4 self.navigationController.navigationBar.translucent = NO;
Transferred from: http://www.itstrike.cn/Question/e0fd5e29-34ef-49fe-9a55-a018878199a2.html
IOS7 How to modify the return button text color, arrow color, and the color of the navigation bar button on navigation bar