开发者

Customize/override view size when using presentModalViewController

开发者 https://www.devze.com 2023-02-14 21:15 出处:网络
I\'m using presentModalView to 开发者_运维知识库display a modal view in an iPad app when my app enters the active state:

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

精彩评论

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

关注公众号