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