ios - Custom barTintColor for navigationBar -


i trying customized color apps navigation bar , it's not coming right. hex code exact color need use blue #023883. looked rbg percentages site: http://www.colorhexa.com/023883 , percentages are: rgb(0.8%,22%,51.4%). put inside code this:

self.navigationcontroller.navigationbar.bartintcolor = [uicolor  colorwithred:0.8 green:22 blue:51.4 alpha:1.0];   self.navigationcontroller.navigationbar.titletextattributes =  @{nsforegroundcolorattributename : [uicolor lightgraycolor]};   self.navigationcontroller.navigationbar.backgroundcolor = [uicolor  whitecolor];   self.navigationcontroller.navigationbar.translucent = yes; 

i tried implement code enables use of inputting hexcode color value didn't work either. there way me able achieve color? (i tried put blue @ 100 , still wasnt dark enough color)

you forget % ,it should be

 self.navigationcontroller.navigationbar.bartintcolor = [uicolor                                                         colorwithred:0.008 green:0.22 blue:0.514 alpha:1.0]; 

enter image description here

edit,about how make statusbar white

  1. set key no in info.plist file view controller-based status bar appearance.click plus icon in right of information property list,then click v in new row,it auto complete,the first 1 key enter image description here
  2. in app delegate

    - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. [application setstatusbarstyle:uistatusbarstylelightcontent]; return yes; } 

enter image description here


Comments