ios - Navigation bar back button colour not working in iPad -
in app, have given navigation bar button colour red. both arrow , text works finely iphone in screens. in ipad works correctly home screen. when enter inside of other view controllers, navigation text in red colour button arrow becomes grey colour. here code,
func setup() { self.navigationbar.bartintcolor = uicolor.blue() uinavigationbar.appearance().titletextattributes = [ nsforegroundcolorattributename : uicolor.white, nsfontattributename : uifont(name: "arial", size: cgfloat(22.0))! ] self.navigationbar.istranslucent = true uinavigationbar.appearance().tintcolor = uicolor.red // self.navigationbar.tintcolor = uicolor(red: cgfloat(132.0 / 255.0), green: cgfloat(204.0 / 255.0), blue: cgfloat(90.0 / 255.0), alpha: cgfloat(1.0)) // draw bottom border let bottomborderheight = 3 / uiscreen.main.scale let bottomborder = uiview(frame: cgrect(x: cgfloat(0), y: cgfloat(self.navigationbar.frame.size.height-bottomborderheight), width: cgfloat(self.view.bounds.width), height: cgfloat(bottomborderheight))) bottomborder.backgroundcolor = uicolor(red: cgfloat(0 / 255.0), green: cgfloat(97 / 255.0), blue: cgfloat(56 / 255.0), alpha: cgfloat(1.0)) self.navigationbar.addsubview(bottomborder) }
tried bartintcolor, appearance, bar style etc..but nothing works. idea? tia.
in swift 3, try line change button color change
self.navigationcontroller?.navigationbar.tintcolor = uicolor.red
i hope it's work you,
Comments
Post a Comment