Search code examples
iosios8uinavigationbaruiinterfaceorientation

Why is pressing back removing all the navigation bar information whilst in landscape?


I've not been able to find anyone speaking of the same problem but i'm quite happy to be pointed to a post where something like this has been resolved.

As it stands, in portrait.

Picture 1: shows a media list, you can click a piece of media
Picture 2: you press the back arrow "<"
Picture 3: It returns you back to the correct page with everything working

enter image description here enter image description here enter image description here



Now, when I attempt to do this with a landscape orientation (locked or unlocked). As you can see, "View Media" at the top has disappeared and so has the Logout button.

enter image description here enter image description here enter image description here

Some things i've noticed about the problem:
After carrying out that second sequence in landscape mode, if I rotate to portrait all the features return. I've also noticed that while it's animating from the View Media page to the piece of media, if I click back ("< View Media") while the black bar is coming across (picture below) it all is there when I go back.

enter image description here

I've got nothing in the code that affects the orientation anymore as I thought i'd remove it all to start debugging but i've tried quite a few things and I think i'm barking up the wrong tree. Anyone pointing me in the right direction would be helpful! Thank you


Solution

  • I found the problem but I wouldn't really call it an answer. I've got the status bar hidden on the second VC in landscape but when I show it everything resumes fully working.. If I want to hide the status bar i'm having to create a fake back button:

    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(popVC)];
    self.navigationItem.hidesBackButton = YES;
    self.navigationItem.leftBarButtonItem = item;
    

    then in popVC just

    [self.navigationController popViewControllerAnimated:YES];