cordova 5 wp8 app build does not rotate

81 Views Asked by At

I use cordova 5.0.0 and build wp8 app. When I rotate the phone, the app doesn't rotate. It seems like some orientation setting or codes are needed. Any ideas on how to do it? For device, I use windows phone 8.1 on Nokia 822.

1

There are 1 best solutions below

0
On

Cordova actually overwrites the orientation attributes defined in MainPage.xaml. Codes in \AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\wp8_parser.js actually remove settings if orientation is defined as 'default' in config.xml, place incorrect settings in MainPage.xaml for other values. You need to write a hook to execute after prepare to overwrite the value cordova sets.