更改UIModalPresentationFormSheet模型样式的当前viewController的框架

时间:2014-08-11 11:54:05

标签: ios objective-c ipad uimodalpresentationstyle

如何更改模型样式“UIModalPresentationFormSheet”的呈现viewController的框架

预期的框架enter image description here

当前帧enter image description here

我试过设置视图边界OverlayViewController.view.superview.bounds = CGRectMake(20,20,600,400)

设置了呈现视图的框架和中心

OverlayViewController.view.superview.autoresizingMask =
        UIViewAutoresizingFlexibleTopMargin |
        UIViewAutoresizingFlexibleBottomMargin |
        UIViewAutoresizingFlexibleLeftMargin |
        UIViewAutoresizingFlexibleRightMargin;
        CGRect screenBounds = [[UIScreen mainScreen] bounds];
        OverlayViewController.view.superview.frame = CGRectMake(20,20,600,400);
        CGPoint center = CGPointMake(CGRectGetMidX(screenBounds), CGRectGetMidY(screenBounds));

还试过setModalPresentationStyle:UIModalPresentationPageSheet,框架无法设置页面的原点

所以请建议如何做到这一点

0 个答案:

没有答案