swift - Change status bar color when navigation bar is hidden -
i want set black color(bar tint color) of status bar , white tint color when navigation bar hidden.
and want specific views. have tried this:
override func viewdidload() { super.viewdidload() self.navigationcontroller?.setnavigationbarhidden(true, animated: true) self.navigationcontroller?.navigationbar.barstyle = uibarstyle.black self.navigationcontroller?.navigationbar.bartintcolor = uicolor.blackcolor() self.navigationcontroller?.navigationbar.tintcolor = uicolor.whitecolor() } i tried thing: set value no in p-list view controller-based status bar appearance.
if trying change status bar color, can use
uiapplication.sharedapplication().statusbarstyle = .lightcontent keep in mind cannot set status bar color other lightcontent , default (black). can set status bar light , throw element behind different color.
if want true way override color make black (default) or light, can try
override var preferredstatusbarstyle: uistatusbarstyle { return .lightcontent } in view controllers want override. if need different background color, throw uilabel behind color , specify light content or default color.
Comments
Post a Comment