I’m try to initialize my UIViewController depending on the orientation of the iPad.
In initWithNibName, I’m using the following code:
CGSize size = self.view.frame.size;
authForm = [[[AuthForm alloc] initWithFrame:CGRectMake(-400,(size.height-400)/2,400,400)] autorelease];
[self.view addSubview:authForm];
This is what I want when the application starts up in portrait mode (upside-down or not), but I want to have this when it starts up in landscape mode (left or right):
authForm = [[[AuthForm alloc] initWithFrame:CGRectMake((size.width-400)/2,-400,400,400)] autorelease];
How could I do that?
I already tried a few things with willAutorotateToInterfaceOrientation: but it didn’t work.
Ok, I didn’t apparently went far enough in the posts about this topic.
I finally found this :
Thanks anyway