Parth Bhatt
Parth Bhatt

Reputation: 19469

iPad : Unable to implement variants of Portrait Orientation

I need to implement both variants of my Portrait orientation in iPad app.

I am using the code shown below to implement both Portrait and PortraitUpsideDown orientations.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation ==  UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}

But orientation does not change when Orientation is PortraitUpsideDown.

What could be wrong?

Upvotes: 1

Views: 236

Answers (2)

Parth Bhatt
Parth Bhatt

Reputation: 19469

Got it working.

Added both the variants of Portrait Orientations to Supported Interface Orientation to my info.plist for my app.

This has worked for me.

Hope this helps everyone.

Upvotes: 1

superandrew
superandrew

Reputation: 1771

you could use

return UIDeviceOrientationIsPortrait(interfaceOrientation)

which is just a macro for what you're trying to get.I'm not sure both will work on simulator.

Upvotes: 0

Related Questions