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
也在子視圖中使用相同的代碼.. –