在 iOS 5 中它可以正常运行:
PinRequiredViewController *pinView = [[PinRequiredViewController alloc]initWithNibName:@"PinRequiredView" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pinView];
// show the navigation controller modally
navController.modalPresentationStyle = UIModalPresentationFormSheet;
navController.modalInPopover = NO;
navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:navController animated:YES completion:nil];
navController.view.superview.frame = CGRectMake(0, 0, 250, 250);
navController.view.superview.center = self.view.window.center;
但在 iOS6 中无法正常工作,视图不会在屏幕中保持居中,无论是纵向还是横向。有什么解决办法吗?
谢谢!!:)