我有一个名为MainViewController的viewController,它有一个UIButton。点按时,此按钮会加载另一个名为ModalSelector的viewController,如下所示:
- (IBAction)showModalSelector:(id)sender {
ModalSelector *modal = [[ModalSelector alloc]
initWithNibName:@"modalSelector" bundle:nil];
modal.modalPresentationStyle = UIModalPresentationFormSheet;
modal.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
modal.modalInPopover = YES;
modal.issues = issuesForModal;
modal.parent = self;
[self presentModalViewController:modal animated:YES];
[modal.view setFrame:CGRectMake(-80, 20, 700, 400)];
[issuesForModal release];
[modal release];
}
然而,当我在模拟器中旋转设备时,两个视图都没有正确旋转,即使我在两个viewControllers中都有这个:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
如何让它正确旋转?
由于
答案 0 :(得分:0)
我发现代码没有问题,但是模拟器本身。当我在实际设备上测试时,它可以很好地工作。