我的模态视图已调整大小,工具栏位于我的模态视图中间,我的按钮仅在 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];
任何人都可以提出任何想法?我不明白是什么问题。