我们如何将手机设置为仅纵向并允许平板在纵向和横向之间切换?
我正在使用 ionic / Cordova 。
目前我已配置为使用以下属性在 config.xml 中将应用程序设置为纵向模式
<preference name="orientation" value="portrait" />
最佳答案
您可以使用 isTablet plugin与 screen orientation plugin 一起使用, 就像是:
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.isTablet){
screen.unlockOrientation();
}else{
screen.lockOrientation('portrait');
}
});
})
关于Cordova/Ionic - 为手机设置仅纵向模式并允许在平板电脑中定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34783909/