0

I am trying to make my status bar and translucent navigation bar "unified", which is the standard look in iOS 7 and above. However, I've got many navigation controllers, view controllers, and a tab bar controller, a view controller that owns all etc. and everything is messed up. Whatever I try, I can't get rid of this look:

enter image description here

The status bar doesn't "merge" with the navigation bar. The problem is not the color, it still doesn't merge when the status bar text is black. I've tried changing the view controller-based status bar setting to both values, no avail.

How can I make them merge?

UPDATE: I've got a very strange observation. I was trying everything I can about layout guides and constraints, and I've tried removing top layout guide code on viewWillAppear::

for (NSLayoutConstraint *constraint in self.view.constraints) {
    if(constraint.firstItem == self.topLayoutGuide && constraint.secondItem == nil){
        //constraint.constant = -20;
        [self.view removeConstraint:constraint];
        break;
    }
}

Suddenly, my status bar started to display perfectly as it should be, unified with the status bar. But no content inside my view controller is displayed now, so obviously, this isn't a solution. But it really seems to be something related to the top layout guide.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
  • nav bar style is set to light? – ShahiM Dec 21 '15 at 09:52
  • @ShahiM if you've meant status bar style, yes. but as I've said, it doesn't matter if it's light content or default, only the text color changes, not the background. – Can Poyrazoğlu Dec 21 '15 at 09:54
  • Did you check in storyboard whether under top bars, under bottom bars are checked? – Anshul Dec 21 '15 at 10:41
  • @Anshul my view controller is 7 levels deep in the storyboard. which one should I check? anyway, they all have extend under top and bottom bars chekced. – Can Poyrazoğlu Dec 21 '15 at 10:44
  • best is to start with the parent controller and then go down deep to 7 levels. – Anshul Dec 21 '15 at 10:49
  • @Anshul oh I think I've just figured out everything. my "master" controller had everything embedded in an embedded view controller and it had it's top spacing to top layout guide "0". but, it was 20px down, so I changed the constraint to "-20". it seems a bit hacky but it just fixed everything and didn't mess anything up. – Can Poyrazoğlu Dec 21 '15 at 10:51

1 Answers1

1

I've just figured out everything. My "master" controller had everything embedded in an embedded view controller and it had it's top spacing to top layout guide "0". But, it was 20px down, so I changed the constraint to "-20". It seems a bit hacky but it just fixed everything and didn't mess anything up.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389