ios - screen orientation issues in phonegap -
i have been using phonegap build. have encountered need run app in portrait mode phones , in landscape mode on tablets (same app - different orientations),from config files see there no such distinction available. pg has ability this?is available in pgb. there soluction this? using below code fixed issues
var devicetype = (navigator.useragent.match(/ipad/i)) == "ipad" ? "ipad" : (navigator.useragent.match(/iphone/i)) == "iphone" ? "iphone" : (navigator.useragent.match(/android/i)) == "android" ? "android" : (navigator.useragent.match(/blackberry/i)) == "blackberry" ? "blackberry" : "null"; if(devicetype=='ipad') { screen.lockorientation('landscape'); } if(devicetype=='iphone') { screen.lockorientation('portrait'); }
Comments
Post a Comment