tags:

views:

4925

answers:

2

I am trying to display a login screen using presentModalViewController on iPad.

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

No matter what size I set the view to be in Interface Builder, it always resizes to about 540x620. But the login screen is nothing more than two text fields and a button. So I only need it to be 460x240.

Does anybody know of a way to resize this?

+7  A: 

Try reading the iPad HIG section on Modal Views. Its pretty clear why that won't work. No body can really tell you much when not in Apple's dev forms since we are under NDA. However the solution I would use if I were you isn't iPad specific but rather what quite a few iPhone apps have been doing for a while. Use a UIAlert view and put your two text fields in that? The down side is you can't use IB to lay it out. Tutorial

jamone
Yeah I read it too, and I thought logging in was something you would use a modal state for. But what you're proposing is ALSO something that goes against the human interface guidelines, because then I misuse an alert dialog. Maybe I'll use a popover view for logging in instead.
Tom van Zummeren
jamone
I was never worried about whether or not it would be approved by Apple. I was just concerned about the user experience. People don't "expect" text input boxes in an alert popup. That's why it's good to follow the guide lines. But you're right, Apple also does it in the appstore. But a popover might work, since you can still do other stuff when not logged in. Anyway, I think you gave the correct answer after all: you simply can't adjust the size of a modal view. =)
Tom van Zummeren
A: 

In wich case adding textField in a UIAlertView may cause the denial of the app in the store ?

None. Read the comments again.
Tom van Zummeren