Matthias
Matthias

Reputation: 63

iPhone: Prevent View from Rotation

I use a UITabBarController with 4 views. The first of those 4 views should be able to rotate, the other three not. And now the problem is, when having a tab bar controller you have to set all used views to rotatable (i.e. returning TRUE in shouldAutorotateToInterfaceOrientation).

So, my question is now, can I prevent the three views from rotation even though the shouldAutorotateToInterfaceOrientation method returns TRUE?

Upvotes: 2

Views: 795

Answers (1)

kitschmaster
kitschmaster

Reputation: 1299

a bit late, but maybe one could solve this by saying something like this in all the shouldAutorotate... methods:

if (firstTabBarIsShowing) {
   return YES; //enable rotation if first tab bar is showing its content
} else {
   return NO; //if other views are showing, don't rotate anything
}

then make sure the view starts with the first tab bar showing. maybe this could trick it.

Upvotes: 1

Related Questions