iphony
iphony

Reputation: 123

iOS 7 : How to change the status bar text color as white in one view controller and black in second view controller?

I need to change the color of status bar text in first view controller to white and in the second view controller it should change to black. Tried with View controller-based status bar appearance to NO and called

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

But it was not changing. Please suggest me.

Upvotes: 2

Views: 1123

Answers (2)

abhishekkharwar
abhishekkharwar

Reputation: 3529

Go to your Plist file and add this property with Bool YES.

Then use

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

Have a look into attached screenshot-

enter image description here

Upvotes: 4

Austen Chongpison
Austen Chongpison

Reputation: 3974

You need to have view controller based status bar appearance set to YES for preferredStatusBarStyle to work. If you're still having issues after that then take a look at this SO question: preferredStatusBarStyle isn't called

Upvotes: 0

Related Questions