views:

605

answers:

2

Hi,

I have a main viewController that is in portrait mode all the time.

I want then to presentModalViewController, but it will come from the left (not from bottom of the screen) in landscape.

Is it possible?

tnx

A: 

In your modal view controller implementation, override -shouldAutorotateToInterfaceOrientation:

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Alex Reynolds
This is the opposite of what i need.
donodare
Can you rephrase your question? I'm not sure which option you're asking.
Alex Reynolds
My main controller is in portrait.Then i turn the device into landscape, but the main controller remains in portrait.Then i want to show another view controller in landscape, and it will show from the bottom. In this situation if you hold the device in vertical(portrait), the new view will come from the left.
donodare
Have you tried `UIInterfaceOrientationLandscape` in the overridden method above?
Alex Reynolds
Yes. I hope I'm clear with my problem.
donodare
A: 

i came across this problem too. so i just used the modaltransitionstyle so it didn't look to iffy.

hope this helps.

viewController.modalTransitionStyle = modaltransitionstyle;

[self prensentmodal... animated...yes];

alex n