使用presentModalViewController时自定义/覆盖视图大小
当我的应用程序进入活动状态时,我使用presentModalView在iPad应用程序中显示模式视图:
- (void)applicationDidBecomeActive:(UIApplication *)application {
myViewController vc = [[myViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationFormSheet;
vc.modalTransistionStyle = UImdoalTransitionStyleCoverVertical;
[self.window.rootViewController presentModalViewController:vc animated:YES];
}
它运行良好,但是myViewController只有320 X 340,但它显示为一个更大的视图。使用presentModalViewController时是否可以自定义或覆盖视图大小?或者除了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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过调整 view.superview.frame 的大小来做到这一点,如下所示:
You could do this by resizing the view.superview.frame like below: