Why doesn't my Cordova/PhoneGap iOS app rotate when the device rotates?

前端 未结 4 1519
囚心锁ツ
囚心锁ツ 2020-11-30 09:36

I am trying to make a landscape only app, but I am not able to produce any rotation at all.

There used to be a autorotate setting in PhoneGap.plis

4条回答
  •  情话喂你
    2020-11-30 09:36

    You can add UISupportedInterfaceOrientations

    platroms/ios/{ProjectName}/{ProjectName-info.plist

    add this rows:

    For Iphone:

    UISupportedInterfaceOrientations
        
          UIInterfaceOrientationPortrait
          UIInterfaceOrientationLandscapeLeft
          UIInterfaceOrientationPortraitUpsideDown
          UIInterfaceOrientationLandscapeRight
        
    

    For Ipad:

    UISupportedInterfaceOrientations~ipad
        
          UIInterfaceOrientationPortrait
          UIInterfaceOrientationLandscapeLeft
          UIInterfaceOrientationPortraitUpsideDown
          UIInterfaceOrientationLandscapeRight
        
    
    | improve this answer | |

提交回复
热议问题