I'm trying to force the "Landscape " mode for my application because my application is absolutely not designed for the "portrait" mode. How can I do that?
I read this but don't understand
https://getsatisfaction.com/apperyio/...
and even this
https://docs.appery.io/docs/appbuilde...
my device is android
-
-
-
-
well actually not any code to change the screen I just try this code :
$( window ).on( "orientationchange", function( event ) {
//alert( "This device is in " + event.orientation + " mode!" );
if(event.orientation=="portrait"){
alert("portrait");
}else{
alert("landscape");
}
});
it just recognizes landscape or portraits not change it by itself (user must rotate the screen(
some app when you open them they will change phone rotation automatically
some game app like HillClimb or ClashRoyal or others.... -
-
-
-
-
Up for this. What command should I use to make all pages stay in Landscape mode?
-
-
EMPLOYEE
1Hello,
You can use the Cordova orientation plugins for that: https://cordova.apache.org/docs/en/la...
it has a method "lock", which sets the fixed orientation:
screen.orientation.lock('landscape');
-
Where do i put this command to lock screen orientation?
-
-
Anywhere in the app, you need to lock the orientation. In the common case - onb the start page, device ready event
-
-
-
-
-
tnx @kulibaba how can i install this plugin i did not find this at Appsetting>>CordovaPlugins
and i searched at CreatNew >> FromPlugin
but i did not find this there
by the way i am using ionic app -
-
-
-
-
-
-
-
Oh i find this it is out of app setting (main page) tnx Dear Evgene Karachevtsev and Dear Serhii Kulibaba
-
-
- view 1 more comment
-
-
-
-
Please, go to the Resources tab, then click the Cordova plugins subtab. There, you will have the option Import Cordova plugins.
-
-
-
-
-
-
-