Can i set different orientations for IPad and IPhone (Universal) app in cordova?

后端 未结 5 1152
失恋的感觉
失恋的感觉 2020-12-17 23:33

I am developing a cordova app for both Ipad and Iphone and i need the iphone app to support only for portrait and ipad app to support only for landscape. Right now i have se

5条回答
  •  甜味超标
    2020-12-18 00:09

    Unfortunately I could not get this to work with edit-config and Cordova 7, but I could get this working with the cordova-custom-config plugin.

    cordova plugin add cordova-custom-config --save
    

    Then add the following to config.xml. Note the custom-config-file elements for version 5 of this plugin instead of the config-file elements, to prevent conflicting with cordova parsing the config-file elements.

    
        
            
                UIInterfaceOrientationPortrait
            
        
        
            
                UIInterfaceOrientationLandscapeLeft
                UIInterfaceOrientationLandscapeRight
            
        
        ...
    
    

提交回复
热议问题