iPad – Adjustment mode UIVIEWCONTROLLER size

I am trying to use presentModalViewController to display the login screen on the iPad.

LoginFormController *controller = [[[LoginFormController alloc] initWithNibName :@"LoginFormView" bundle:nil] autorelease];
[controller setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[controller setModalPresentationStyle:UIModalPresentationFormSheet];
[self controller:loginFormController animated:YES];

No matter I set the view to the size of Interface Builder, it always adjusts to about 540×620. But the login interface is nothing more than two text fields and a button. So I only need 460×240.

Does anyone know how to adjust the size?

Try to read the iPad HIG section on Modal Views. It’s clear why this doesn’t work. Because we Under the NDA, so when not in Apple’s development form, no agency can really tell you. However, if I were you, the solution I would use is not iPad specific, but quite a few iPhone apps have been Did it for a while. Use the UIAlert view and put two text fields in it? The downside is that you can't solve it with IB.
Tutorial

I tried to use presentModalViewController to display the login screen on the iPad.

LoginFormController *controller = [[[LoginFormController alloc] initWithNibName:@"LoginFormView" bundle:nil] autorelease];
[controller setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[controller setModalPresentationStyle:UIModalPresentationForm]
[self controller:loginFormController animated:YES];

No matter I set the view to the size of Interface Builder, it always adjusts to about 540×620. But the login interface is only two A text field and a button. So I only need 460×240.

Does anyone know how to adjust the size?

Try to read the iPad HIG section on Modal Views. It's clear why this doesn't work. Because we are under NDA, so when not in Apple's development form Nobody can really tell you when you are in the middle. However, if I were you, the solution I would use is not iPad-specific, but quite a few iPhone apps have been doing it for a while. Use the UIAlert view and combine the two Where is the text field? The downside is that you cannot use IB to solve it.
Tutorial

Leave a Comment

Your email address will not be published.