I’ve searched this forum (and others) but haven’t found a solution yet.
I have a app in landscape mode. Everythin fine, but when I change to another view (with a UITable) its in portrait mode and doesnt rotate. I have tried whole day but cant figure it out.
@property (nonatomic, strong) IBOutlet UIView *aView;
@property (nonatomic, strong) IBOutlet UIViewController *aViewcontroller;
-----
aViewcontroller = [[UIViewController alloc] initWithNibName:@"ViewController" bundle:nil];
aViewcontroller.view = aView;
-----
[self presentModalViewController:aViewcontroller animated:YES];
//got my view in portrait orientation.
My views in my .xib file are all set to Orientation:Landscape.
This should be simple, right?
Thanks beforehand!
By default UIViewController supports only Portrait orientation. In order to support other orientations you need create new custom view controller which supports the orientations you need.
Steps:
Create new custom view controller
ViewControllerLandscapeThen import it to your mainn view controller
Change your code:
in your
ViewControllerLandscapeadd the method: