开发者

UIInterface Orientation Issue

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜