我有一个带有自定义模态视图控制器的应用程序,这个控制器位于导航控制器内,这里是我的代码:
CalendarViewController *calendarViewController = [[CalendarViewController alloc] initWithNibName:@"CalendarViewController" bundle:nil];
[calendarViewController setDelegate:self];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:calendarViewController];
[navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
[navigationController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:navigationController animated:YES];
navigationController.view.superview.frame = CGRectMake(0, 0, 630, 555);
navigationController.view.superview.center = self.view.center;
问题是此导航控制器不在屏幕中心。这个屏幕的位置是ipad的右侧。有没有解决方案如何集中这个自定义控制器。非常感谢。