当我使用此代码时:
- (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];
}
}
子视图旋转。在我的项目中,子视图必须保持固定的肖像。