我需要帮助解决问题。我想在旋转事件后打开时动态更改modalPresentationStyle。 我写这个用于创建模态视图
ZUITableViewController *ivc = [[ZUITableViewController alloc] init];
ivc.delegate = self;
_modalIsShowing = TRUE;
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:ivc];
if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
{
nc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
nc.modalPresentationStyle = UIModalPresentationFormSheet;
}
else{
nc.modalPresentationStyle = UIModalPresentationFullScreen;
}
[self presentModalViewController:nc animated:YES];
[ivc release];
[nc release];
答案 0 :(得分:0)
废弃if语句UIModalPresentationPageSheet
行为正常以开始。
ZUITableViewController *ivc = [[ZUITableViewController alloc] init];
ivc.delegate = self;
_modalIsShowing = TRUE;
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:ivc];
nc.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentModalViewController:nc animated:YES];
[ivc release];
[nc release];