Stop UIToolbar from disappearing in landscape orientation - iPad

I don’t know why this is happening or how to stop it; mine UIToolBaris viewcontrollervisible in details only in portrait mode. I want it to be visible in all directions. How should I do it? Thank.

+3
source share
2 answers

I ran into the same problem just by dragging and dropping the UIToolBar in my opinion and setting it to the top of the window. He appeared in the landscape, but not in the portrait. The Builder interface - at least the one that is built into Xcode 4 - does not seem to be suitable for resize masks.

Kshitiz , . , . , .

, /. :

  • Interface Builder.
  • .
  • Autosizing , "i-" . , , .
  • Autosizing . .
+14

reset view frame bro

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Override to allow orientations other than the default portrait orientation.
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {
        self.view.frame = CGRectMake(0, 0, 703,768);    

        } else {
        self.view.frame = CGRectMake(0, 0, 768, 1024);
        }


    return YES;
}

0

All Articles