我的模态视图已调整大小,工具栏位于我的模态视图中间,我的按钮仅在iOS 6中位于视图之外,但相同的代码在iOS 5中运行良好。
这是我的代码段:
ModalViewController *viewController = [[ModalViewController alloc] initWithNibName:@"ModalView" bundle:nil];
viewController.delegate = self;
viewController.modalPresentationStyle = UIModalPresentationFormSheet;
viewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:viewController animated:YES];
CGRect frame = self.view.frame;
int x = (frame.size.width - 470 )/2;
int y = (frame.size.height - 420 )/2;
CGRect r = CGRectMake(x,
y,
470, 420);
r = [self.view convertRect:r toView:viewController.view.superview.superview];
viewController.view.superview.frame = r;
[viewController release];
任何人都可以提出任何想法?我不明白这是什么问题。
答案 0 :(得分:1)
我已经通过更改
解决了这个问题viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;