bal
Posts: 0
Joined: Sat Nov 22, 2014 8:04 pm

Page orientation lock on portrait on one page

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?

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Page orientation lock on portrait on one page

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

bal
Posts: 0
Joined: Sat Nov 22, 2014 8:04 pm

Page orientation lock on portrait on one page

Hi M&M,

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

bal
Posts: 0
Joined: Sat Nov 22, 2014 8:04 pm

Page orientation lock on portrait on one page

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?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Page orientation lock on portrait on one page

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?

bal
Posts: 0
Joined: Sat Nov 22, 2014 8:04 pm

Page orientation lock on portrait on one page

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Page orientation lock on portrait on one page

Bal,

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

Return to “Issues”