cordova - How to block Landscape Orientation mode in ONSEN-UI? -
i developing onsen application, in want allow portrait mode device , want set off landscape mode. how that?
onsen ui doesn't provide function disable landscape mode, because functionality platform dependent. can is, first, detecting orientation ons.orientation, followed platform ons.platform, , apply default platform instructions block landscape mode.
an easier solution rotate view portrait, after has been rotated in landscape.
window.addeventlistener('orientationchange', function () { if (window.innerheight > window.innerwidth) { document.getelementsbytagname('body').style.transform = "rotate(90deg)"; } });
Comments
Post a Comment