简体   繁体   English

知道Flash Builder中用于移动设备的设备

[英]Know what device in flash builder for mobile

I'm doing an application for mobile devices, specifically for iphone and ipad. 我正在为移动设备开发应用程序,特别是针对iPhone和iPad的应用程序。 And I want to use different interfaces for each. 我想为每个接口使用不同的接口。 How can I do that? 我怎样才能做到这一点? Is there a variable that holds the name of the device? 是否存在保存设备名称的变量? Such as

if(device=="iPhone")
    {use this state}
else if (device=="iPad")
    {use that state}

?? ??

您可以使用Capabilities.os获取设备的操作系统,并查看它是否使用iOS,然后使用Capabilities.screenResolutionXCapabilities.screenResolutionY来确定分辨率是否与iPhone或iPad相对应。

Look at this document which shows general principles for scaling things based on the screen resolution. 请看这份文档该文档显示了根据屏幕分辨率缩放内容的一般原则。

It is not an exact answer to your question but I am guessing that you just want to scale your interfaces based on the screen resolution. 它不是您问题的确切答案,但我想您只是想根据屏幕分辨率缩放界面。

You can also check the screen DPI using Capabilities.screenDPI. 您也可以使用Capabilities.screenDPI.检查屏幕DPI Capabilities.screenDPI. which is nice to know how spread out those pixels are along with Capabilities.screenResolutionX and Capabilities.screenResolutionY to get the resolution. 很高兴知道这些像素与Capabilities.screenResolutionXCapabilities.screenResolutionY分布情况如何以获得分辨率。

If you really want to know what the operating system is you can check using Capabilities.os , but as for an exact device I'm not sure if there is a method for that. 如果您真的想知道什么操作系统,可以使用Capabilities.os进行检查,但是对于确切的设备,我不确定是否有相应的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM