Reputation: 421
How can I load my app only in portrait state, when shown launch image? My app support all orientations, but I need launch it in portrait state for my launch image
Upvotes: 0
Views: 344
Reputation: 736
//Try this it will work
//Option 1:
in .plist file make changes only in row Supported interface orientations
//Option 2:
if the above thing is not working try like this
which image you are using for Landscape, edit and save the same image with different name for Portrait and rotate that image using your Preview from Landscape to Portrait(left to right or right to left).
Upvotes: 2
Reputation: 4091
Add this code In AppDelegate for first launch,
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
}
Implementing this method in each view controller :
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation); // whatever you need put here.
}
Upvotes: 1