开发者

How to allow only for 180 degrees of autorotation?

For my iPad app, I intend to disable autorotation. However I heard that apple will reject the app as they expect the app to at least be able to rotate 180 degrees. Has anyone experienced this before? Any truth in this?

In any case, can anyone advise me on how I can set the autorotation to only for portrait mode开发者_StackOverflow社区? i.e. only allow rotation of 180 degrees.

Any help on this will be greatly appreciated.

Thanks

Zhen


In your view controller, override shouldAutorotateToInterfaceOrientation

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}


The answer is yes, if you simply set the BOOL to No in shouldAutoRotateToInterfaceOrientation. I have seen tones of other gaming apps that allow only Landscape or Portrait though, so 180 degree at least, I guess.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜