I have set my iPad app to Landscape mode using following code..
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
return NO;
}
return YES;
}
}
When i manually rotate the simulator then it will go in Landscape and never goes in Portrait mode.
Just during Startup my app goes in Portrait mode.
How can i detect the Landscape mode only or How should i set to only Landscape mode???
I tried from BuildSettings too but unable to solve problem...
You most likely did not remove portrait as a supported interface orientation in your project plist file.
You can (in newer versions of Xcode) find it in the "Supporting Files" folder of your project.
Note that there's a separate setting for iPhone and iPad, so you could do the interfaces differently depending on platform.