xcode - Objective - C how do I change the color of UINavigationItem -


how change colour of uinavigationitem black white?

enter image description here

i have tried following in lhappdelegate.m:

[[uinavigationbar appearance] settintcolor:uicolorfromrgb(0xffffff)];   [[uinavigationbar appearance] setbartintcolor:[uicolor greencolor]]; 

changes whole bar green, trying change colour of black text 'update tasks'

enter image description here

if want have solid color navigation bar in ios 6 similar ios 7 use this:

[[uinavigationbar appearance] setbackgroundimage:[[uiimage alloc] init] forbarmetrics:uibarmetricsdefault]; [[uinavigationbar appearance] setbackgroundcolor:[uicolor greencolor]]; 

in ios 7 use bartintcolor this:

navigationcontroller.navigationbar.bartintcolor = [uicolor greencolor]; 

or

[[uinavigationbar appearance] setbartintcolor:[uicolor greencolor]]; 

edit 1

to update text color, use below.

[[uinavigationbar appearance] settitletextattributes:@{nsforegroundcolorattributename : [uicolor whitecolor]}]; 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -