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:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
var so = cordova.plugins.screenorientation;
so.setOrientation(so.Orientation.PORTRAIT);
}
It doesn't work. Is there anybody who succesfully implement this plugin? Is there any workaround?
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:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
var so = cordova.plugins.screenorientation;
so.setOrientation(so.Orientation.PORTRAIT);
}
It doesn't work. Is there anybody who succesfully implement this plugin? Is there any workaround?
Flag this post as spam/abuse.
Hi Anil,
Thanks a lot for you reply. The library version is 3.1. I have tried github.com/.../cordova-yoik-screenorientation and one other, but couldn't get it work. I want to lock only one page. I will try github.com/.../PhoneGap-OrientationLock and will update you whether it works.
TIA
I think i have tested this plugin before. The problem with this plugin is, that it will only work for the first time. When you close the app and open it again, then it will not work (also your navigation buttons will not work anymore). Maybe im not using the right events. I have on page show: window.plugins.orientationLock.lock("portrait");
and on page hide: window.plugins.orientationLock.unlock();
Any idea's?
Hello
We've tried to use plugin https://github.com/cogitor/PhoneGap-OrientationLock. We created two screens (say A and B). From screen A we did navigation to screen B. For "page Show" event we created javascript handler and invoke plugin function:
window.plugins.orientationLock.lock("portrait");
For "hide" event of screen B we invoke next plugin function:
window.plugins.orientationLock.unlock();
Apllication works as expected - screen orientation for page B is locked. Moreover we closed and opened application and screen locking fuctionality is working.
Please, if it possible, send us backup of your project.
We have tested it on HTC One Android 4.0.3. What devices you tested on?
I have test this on an Android phone with version 4.4.4. How can i share the project with support? Creating a support ticket?
In order to get backup of the project, please use top menu Actions -> Backup (inside App Builder). After that you can send it to me (pantipov@progress.com).
Youre right. I have tested it on another android phone with version 4.4.3, there it works. Maybe its due my phone :(