NSString *nibName = NSStringFromClass([ViewControllerclass]);
ViewController *viewController = [[ViewControlleralloc] initWithNibName:nibName bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
nav.modalPresentationStyle = UIModalPresentationFormSheet;
[selfpresentViewController:nav animated:YES completion:nil];
// 改变弹出界面大小——iPad
// 设置高度,自己使用frame修改,iOS6正常改变frame都正常,iOS7就不正常,得加下面的方法
nav.view.superview.height -= 200;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ViewController中添加方法
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// 设置界面大小
CGPoint centerPoint = CGPointMake([[UIScreenmainScreen] bounds].size.width/2, [[UIScreenmainScreen] bounds].size.height/2);
[UIViewanimateWithDuration:0.3 animations:^{
self.navigationController.view.superview.center = centerPoint;
}];
}