本文介绍了UIModalPresentationFormSheet 调整视图大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很想知道在使用 modalPresentationStyle
的 UIModalPresentationFormSheet
时如何调整视图的大小,看起来它有一个固定的大小,所以我想知道是否有人出来确实设法从调整大小的角度操纵弹出视图.
I am interested to know on how I can resize the view when using UIModalPresentationFormSheet
of modalPresentationStyle
, it looks like it has a fixed size so I was wondering if anyone out there did managed to manipulate the popup view from the sizing perspective.
所以有固定视图大小或完整视图的 UIModalPresentationFormSheet
,我在两者之间.
So there is either UIModalPresentationFormSheet
with a fixed view size or full views and I am after something in between.
推荐答案
MyModalViewController *targetController = [[[MyModalViewController alloc] init] autorelease];
targetController.modalPresentationStyle = UIModalPresentationFormSheet;
targetController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:targetController animated:YES];
// it is important to do this after presentModalViewController:animated:
targetController.view.superview.bounds = CGRectMake(0, 0, 200, 200);
这篇关于UIModalPresentationFormSheet 调整视图大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!