开发者

Customize/override view size when using presentModalViewController

I'm using presentModalView to 开发者_运维知识库display a modal view in an iPad app when my app enters the active state:

- (void)applicationDidBecomeActive:(UIApplication *)application {  
  myViewController vc = [[myViewController alloc] init];  
  vc.modalPresentationStyle = UIModalPresentationFormSheet;  
  vc.modalTransistionStyle = UImdoalTransitionStyleCoverVertical;  
  [self.window.rootViewController presentModalViewController:vc animated:YES];  
}

It functions fine, however myViewController is only 320 X 340, yet it gets displayed as a much larger view. Is there anyway to customize or override the view size when using presentModalViewController? Or is there some way other than presentModalViewController to display a modal view?


You could do this by resizing the view.superview.frame like below:

vc.view.superview.frame = CGRectMake(0, 0, 900, 700);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜