문제

I would like to know how to disable Portrait and UpsideDown orientations in my app for iOS 5.1.1. I want my app to use only LandScape orientation (interface was drawn in Interface Build in .xib file) and don't change it in case of rotation.
I need it especially for iOS 5.1.1

도움이 되었습니까?

해결책

A similar question: how do you make an app ONLY support landscape?

This method was used in the answer above:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
        return YES;

    return NO;
}

다른 팁

You can set it in project settings. In xCode 5 you open the project navigator, click on your project, click on the general tab, and check the boxes you want.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top