iPad - 调整模态UIViewController的大小

Tom*_*ren 3 model-view-controller ipad

我试图在iPad上使用presentModalViewController显示登录屏幕.

LoginFormController *controller = [[[LoginFormController alloc] initWithNibName:@"LoginFormView" bundle:nil] autorelease];
[controller setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[controller setModalPresentationStyle:UIModalPresentationFormSheet];
[self controller:loginFormController animated:YES];
Run Code Online (Sandbox Code Playgroud)

无论我将视图设置为Interface Builder的大小,它总是调整到大约540x620.但登录界面只不过是两个文本字段和一个按钮.所以我只需要460x240.

有人知道调整大小的方法吗?

jam*_*one 7

尝试阅读Modal Views上的iPad HIG部分.很清楚为什么这不起作用.因为我们处于NDA之下,所以当不在Apple的开发表单中时,没有任何机构可以真正告诉你.然而,如果我是你,我将使用的解决方案不是iPad特定的,而是相当多的iPhone应用程序已经做了一段时间.使用UIAlert视图并将两个文本字段放在其中?不利的一面是你不能用IB来解决它. 教程