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