Page 1 of 1

Page orientation lock on portrait on one page

Posted: Tue Jan 20, 2015 10:17 am
by bal

Hi,
I have read all the forum posts here around this topic, but there is no solution. Is it possible to lock the page orientation on 1 page to portrait, so the rotation is not possible?

I have also configured the https://github.com/yoik/cordova-yoik-... plugin. I have put on this code on the specific page:

Code: Select all

 document.addEventListener("deviceready", onDeviceReady, false); 
 function onDeviceReady() 
 { 

    var so = cordova.plugins.screenorientation; 
    so.setOrientation(so.Orientation.PORTRAIT); 
 } 

Is there anybody who succesfull implement this plugin? Is there any workaround?


Page orientation lock on portrait on one page

Posted: Tue Jan 20, 2015 11:03 am
by M&M

For iOS you can do it from the App Settings page. There you can select the Orientations that you want the App to be able to use.

As for Android from what I know you would need to export the App to Eclipse and modify the manifest file and build your Apk from there

Your manifest file will have to be modified to

You can use the value sensorPortrait if you want to handle the 180 degrees rotation.

M&M


Page orientation lock on portrait on one page

Posted: Tue Jan 20, 2015 2:18 pm
by bal

Hi M&M,

This is for the whole application. I want to set this for only 1 page.


Page orientation lock on portrait on one page

Posted: Tue Jan 20, 2015 3:39 pm
by Evgene Karachevtsev

Hello Bal,

Could you please clarify, have you seen thess posst: http://stackoverflow.com/questions/25...
http://stackoverflow.com/questions/70...


Page orientation lock on portrait on one page

Posted: Wed Jan 21, 2015 9:20 am
by bal

Hi Evgene,

I have started testing the plugin: pg-plugin-screen-orientation

I have the problem that the plugin works for the first time. I have added the page show event for the homepage and fired the following statement:

navigator.screenOrientation.set('portrait');

And after the page hide, i have put the:

navigator.screenOrientation.set('fullSensor');

This works perfectly, only the homepage can be set up as portrait and all the other pages can be landscape as well..

But now..when i close the app and start it again, nothing is working (also the navigation pane is not working)

What im doing wrong?


Page orientation lock on portrait on one page

Posted: Wed Jan 21, 2015 5:00 pm
by Evgene Karachevtsev

Bal,

Could you please clarify, do you have any errors in a browser and please specify what device with what OS do you use for test?


Page orientation lock on portrait on one page

Posted: Wed Jan 21, 2015 5:06 pm
by bal

I havent test the plugins from the browser. Im testing after compiling on a Android device with version 4.4.4


Page orientation lock on portrait on one page

Posted: Wed Jan 21, 2015 6:12 pm
by Evgene Karachevtsev

Bal,

Could you please share your project with support, tell us its name and steps to reproduce the issue?