Search code examples
visual-studio-2015phonegapapache-cordova

Apache Cordova portrait orientation forcing not working


In a Visual Studio 2015 Apache Cordova application, I went to the config.xml file and set Orientation = "Portrait". When I see the result in all Android emulators, and in a real device, this setting has no effect, because if I turn the device the layout of the page is completely destroyed.

I searched a lot for this issue but couldn't find any solution. Do I have to spend hours and hours to manage the layout when the phone is in landscape mode?


Solution

  • when I launch the Ripple emulators and I switch to landscape mode, it adapts the screen content.

    That's where the problem is. Ripple doesn't provide a complete simulation of Cordova APIs or native device capabilities (plugins).

    Please refer to Cautions of Run your Apache Cordova app on the Apache Ripple simulator.

    So please try that on real device or an emulator. I tried it on emulator and it works fine.