0

我有以下代码允许我将我的特定视图旋转到横向,但是一旦它变成横向它就不会旋转回纵向?任何帮助表示赞赏。

@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;
}

//覆盖以允许默认纵向以外的方向。- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // 支持的方向返回 YES return YES;//(interfaceOrientation == UIInterfaceOrientationPortrait); }

Thanks for your help!
4

1 回答 1

0

Try this shouldAutorotate method :

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return YES;
}
于 2010-11-23T21:52:52.990 回答