AS3/AIR:如果手机用纵向,如果平板用横向? [英] AS3/AIR: If phone use portrait, if tablet use landscape?

查看:25
本文介绍了AS3/AIR:如果手机用纵向,如果平板用横向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我已经为自己编写了一个简单的 DeviceCapabilites 类,以便能够检查设备是手机还是平板电脑等.

Ok, I've written myself a simple DeviceCapabilites class to be able to check if the device is a phone or tablet etc.

但我需要能够说,如果用户在手机上,它应该处于纵向模式,如果在平板电脑上,我只想使用横向模式......有什么想法吗?

But I need to be able to say that if the user is on a phone, it should be in portrait mode, and if on tablet I only wanna use landscape mode... Any ideas?

为了清楚起见,我想在手机上将方向锁定为纵向模式,然后在平板电脑上使用横向.

To make it clear, I want to lock the orientation to portrait mode on phones and then use landscape on tablets.

推荐答案

类似的事情?

stage.autoOrients = false;

if(YourDeviceCapsClass.isTablet)
    stage.setOrientation(StageOrientation.ROTATED_LEFT);
else
    stage.setOrientation(StageOrientation.DEFAULT);

这篇关于AS3/AIR:如果手机用纵向,如果平板用横向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆