14

I'm using UISearchBar as header of UITableView. UISearchBar style is UISearchBarStyleMinimal. And when search is active, status bar change to black. How to fix that?

Before search is active

Before search is active

Search is active

Search is active

9891541
  • 251
  • 3
  • 14
  • Please go through this link may be help you http://stackoverflow.com/questions/17678881/how-to-change-status-bar-text-color-in-ios-7 – Dipen Chudasama Oct 02 '13 at 05:13
  • 1
    http://stackoverflow.com/questions/18929864/how-do-i-change-the-navigation-bar-color-in-ios-7/18929980#18929980 – Rajneesh071 Oct 02 '13 at 06:42
  • The problem is i want to set status bar as default style. LightContent is ok but all most view controller in my app using default style. – 9891541 Oct 02 '13 at 08:13
  • 2
    The solution is : self.navigationController.view.backgroundColor = [UIColor whiteColor]; self.navigationController.navigationBar.translucent = NO; – 9891541 Oct 02 '13 at 08:21

1 Answers1

21

you just need to do this:

self.navigationController.view.backgroundColor = [UIColor lightGrayColor];
Silence.Kidd
  • 259
  • 2
  • 3
  • 3
    This fixed my problem, but the question is why do we need to do this? It seems like a bug on Apple's part. – Peter Apr 26 '14 at 00:14