testVC.modalPresentationStyle = UIModalPresentationFormSheet; 更改 VC大小

 

本文转载至 http://www.cocoachina.com/bbs/simple/?t31199.html

TestViewController *testVC = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
    testVC.modalPresentationStyle = UIModalPresentationFormSheet;
    testVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:testVC animated:YES];
    testVC.view.superview.frame = CGRectMake(0, 0, 649, 397);//it's important to do this after presentModalViewController
    testVC.view.superview.center = self.view.center;

注意:/it's important to do this after presentModalViewController

 

 

 

 

 TestViewController *testVC = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
    testVC.modalPresentationStyle = UIModalPresentationFormSheet;
    testVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:testVC animated:YES];
    testVC.view.superview.frame = CGRectMake(0, 0, 649, 397);//it's important to do this after presentModalViewController
....... 

K,问题解决。。。还一定要在[self presentModalViewController:testVC animated:YES];之后设置frame的大小!!

posted @ 2014-07-01 16:59  天牛  阅读(432)  评论(0编辑  收藏  举报