user2213271
user2213271

Reputation: 421

launch iPad app in portrait state

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

Answers (2)

Lokesh Chowdary
Lokesh Chowdary

Reputation: 736

//Try this it will work

//Option 1:

in .plist file make changes only in row Supported interface orientations enter image description here

//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

karthika
karthika

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

Related Questions