开发者

UIInterface Orientation Issue

开发者 https://www.devze.com 2023-01-25 10:26 出处:网络
I have the following code which allows me to rota开发者_Go百科te my specific view to landscape, however once it goes to landscape it will not rotate back to portrait? Any help is appreciated.

I have the following code which allows me to rota开发者_Go百科te 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!


Try this shouldAutorotate method :

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

精彩评论

暂无评论...
验证码 换一张
取 消