當應用程序處於橫向模式(我打算強制執行)時,顯示模式視圖會導致父視圖旋轉到縱向模式。如果將shouldAutoRotateToInterfaceOrientation的返回值設置爲NO,則父代不會旋轉,但是模式會從側面滑入並側向顯示。下面是揭示模態的代碼。iPad Modal View旋轉parentViewController查看
- (IBAction)loadExistingGame:(id)sender {
SavedGamesTableViewController *savedGames = [[SavedGamesTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
savedGames.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:savedGames animated:YES];
[savedGames release];
}
根據要求在這裏是的SavedGamesTableViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Override to allow orientations other than the default portrait orientation.
return YES;
}
請出示的'內SavedGamesTableViewController shouldAutoRotateToInterfaceOrientation'實施。 – 2010-09-20 02:17:52
增加了方法,但它只是鍋爐板生成的代碼。 – Kyle 2010-09-20 02:56:05