I am building hybrid mobile application. I need to restrict orientation to portrait mode for specific screen alone. The entire page is a single html. Is it possible to set portrait or landscape specific to div. I would like to know if there is possibility to handle such case.
Asked
Active
Viewed 133 times
1 Answers
0
You can use cordova-plugin-screen-orientation
to change (or lock/unlock) the app orientation programmatically:
// set to either landscape
screen.lockOrientation('landscape');
// allow user rotate
screen.unlockOrientation();
// access current orientation
console.log('Orientation is ' + screen.orientation);

daserge
- 1,512
- 12
- 18