AS3 / AIR:如果手机使用的画像,如果平板电脑使用的景观? [英] AS3/AIR: If phone use portrait, if tablet use landscape?

查看:212
本文介绍了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天全站免登陆