I\'m working on Ionic/Cordova, I added this to androidManifest.xml
but this didn\'t work for me and app is still showing in both ways
android:sc
Inside your angular app.js
add the line screen.lockOrientation('portrait');
like shown bellow:
an
angular.module('app', ['ionic'])
.run(function($ionicPlatform) {
// LOCK ORIENTATION TO PORTRAIT.
screen.lockOrientation('portrait');
});
})
You will also have other code in the .run
function, but the one you are interested in is the line I wrote.
I haven't added the line
in my code, but you may need to add the cordova-plugin-device-orientation