IOS屏幕自動旋轉,強制橫豎屏方法:spa
- (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { return (UIInterfaceOrientationMaskAll); } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); }
要注意的地方:code
若是在subViewController中複寫rotate相關的方法是不會起做用的。blog