开发者

Rotate Interface only 180º

I 开发者_如何学运维just want to rotate my app aways 180º. So, I won't get it in portrait mode.

My code is like this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}

How can I do it?

EDIT:

I dont know why, but it stoped working. Any ideas? Even when i set return YES


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

That will make it so your view controller can only be in landscape orientations. UIInterfaceOrientationIsLandscape() documentation.


The return value of this method determines whether rotation to interfaceOrientation should be allowed. Therefore, you could check whether interfaceOrientation is landscape, and return YES only if so.

return UIInterfaceOrientationIsLandscape(interfaceOrientation);


I don't know why, but on of my TabBar items wasn't set with a NIB name. That's what was causing the error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜