ios - Change statusBar Color ios8 - Xcode 6.1 -
ios - Change statusBar Color ios8 - Xcode 6.1 -
i have tabbarapp,
the 1 tab navigationcontroller
, include status bar
the 2 simple viewcontroller
added navigationbar
( include status bar)
the 3 tab doesn't have status bar
i changed plist file viewcontrollerbasedstatusbarappearence
yes
because need each tab have different handling status bar ( 1st , 2nd tab must have it, 3rd must have hidden )
i wrote within first 2 controllers...
override funct preferredstatusbarstyle() -> uistatusbarstyle { homecoming uistatusbarstyle.lightcontent } override func prefersstatusbarhidden() -> bool { homecoming false }
and wrote within 3rd controller
override func prefersstatusbarhidden() -> bool { homecoming true }
but doesn't work. 3rd controller doesn't have status bar expecting. 1st controller have status bar of same color of nav bar 2nd controller doesn't nav bar color ( cause not nav controller, navbar )
so how can set bar have color want without getting navbarcontroller
? , how can set items in status bar ( icons... ) have white color instead of black? ( navbar text white )
if want alter color of content in status bar (without using uiviewcontroller/uinavigation controller automatic stuff) (so 2 view controller) can utilize setstatusbarstyle(_ statusbarstyle: uistatusbarstyle, animated animated: bool) on uiapplication. place next in viewwillappear (or wherever makes sense/works best) in 2 view controller:
uiapplication.sharedapplication().setstatusbarstyle(uistatusbarstyle.lightcontent, animated: false)
docs: https://developer.apple.com/library/ios/documentation/uikit/reference/uiapplication_class/#//apple_ref/occ/instm/uiapplication/setstatusbarstyle:animated:
ios objective-c swift uiappearance
Comments
Post a Comment