user2999125
user2999125

Reputation: 41

view does not rotate when orientation is upsidesidedown in ios 7

I tring to make app support all orientation. Its working fine but only upside down orientation is not working. I am using ios7. For upside down the view does not rotate. I tried following code

-(BOOL)shouldAutorotate  
{
return yes;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll; // etc
}

My only second method is called but not first method. In infoPlist I enabled all the supported orientations.

Upvotes: 2

Views: 1445

Answers (2)

John Erck
John Erck

Reputation: 9538

Found the fix. Sourced mainly from: https://stackoverflow.com/a/12758715/394969

In a nutshell for people who land here first:

/* In your view controller */
// Add support for upside down 
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

Also flip on all device orientations in project settings as outlined in @Jignesh Mayani's answer. If that doesn't immediatley fix your issue check the link above for how to work with nav controllers and tab controllers (they all must support the required interface orientations).

Upvotes: 5

Jignesh Mayani
Jignesh Mayani

Reputation: 7213

Confirm that you have check, Go your project setting and Check enter image description here

Upvotes: 0

Related Questions