0
votes

I have the following code which allows me to rotate my specific view to landscape, however once it goes to landscape it will not rotate back to portrait? Any help is appreciated.

@implementation SubMenusViewController
@synthesize subMenusView;
@synthesize mainMenuData;

// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization
  subMenusView=[[SubMenusView alloc] initWithFrame:[UISettings rectOfFullScreen:UIInterfaceOrientationPortrait]];
    }
    return self;
}

//Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES;//(interfaceOrientation == UIInterfaceOrientationPortrait); }

Thanks for your help!
1
My apologies, I left out this section; //Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES;//(interfaceOrientation == UIInterfaceOrientationPortrait); }James

1 Answers

0
votes

Try this shouldAutorotate method :

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return YES;
}