开发者

UIModalPresentationStyle View with Custom View Size

开发者 https://www.devze.com 2023-03-13 07:59 出处:网络
Is it possible to have custom size of the view, when you select \"UIModalPresentationFormSheet\" Right now it seems as if this is out of our control?

Is it possible to have custom size of the view, when you select "UIModalPresentationFormSheet" Right now it seems as if this is out of our control?

According to following link, it seems you can't change the default sizes.

http://www.t开发者_StackOverflowhizzer.com/2011/05/uimodalpresentationstyle-frame-size-ipad/


MyModalViewController *targetController = [[[MyModalViewController alloc] init] autorelease]; 

targetController.modalPresentationStyle = UIModalPresentationFormSheet;

targetController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; //transition shouldn't matter 

[self presentModalViewController:targetController animated:YES];


targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it's important to do this after 


targetController.view.superview.center = self.view.center;
0

精彩评论

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

关注公众号