0
当我用这个代码:不要旋转子视图
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration: (NSTimeInterval)duration {
if ((toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft) || toInterfaceOrientation==UIInterfaceOrientationLandscapeRight) {
LeftLVC* vc = [[LeftLVC alloc] initWithNibName:@"LeftLVC" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
}
}
子视图旋转。在我的项目子视图必须保持固定的肖像。
如果你不想旋转视图'return false' – Popeye
你不理解我。我在主视图上使用此代码,以使子视图自动旋转。 – Daedelus
也在子视图中使用相同的代码.. –