加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

关于获取Flex Mobile屏幕宽高

发布时间:2020-12-15 04:49:17 所属栏目:百科 来源:网络整理
导读:1. mobile width and height ? import flash.display.Screen; import flash.system.Capabilities; ? trace(Capabilities.screenResolutionX,Capabilities.screenResolutionY,Capabilities.screenDPI); ? trace(Screen.mainScreen.bounds.width,Screen.mainSc

1. mobile width and height

?

import flash.display.Screen;

import flash.system.Capabilities;

?

trace(Capabilities.screenResolutionX,Capabilities.screenResolutionY,Capabilities.screenDPI);

?

trace(Screen.mainScreen.bounds.width,Screen.mainScreen.bounds.height);

?

trace(stage.fullScreenWidth,stage.fullScreenHeight);

?

2. topLevelApplication width and height

?

var application:UIComponent = FlexGlobals.topLevelApplication as UIComponent;????

?trace(application.width,application.height);

?

3. actionBar width and height

trace(FlexGlobals.topLevelApplication.actionBar.width,FlexGlobals.topLevelApplication.actionBar.height);

?

4. task bar width and height

trace(Screen.mainScreen.bounds.width,Screen.mainScreen.bounds.height);

trace(Screen.mainScreen.visibleBounds.width,Screen.mainScreen.visibleBounds.height);

trace(Screen.mainScreen.bounds.height - Screen.mainScreen.visibleBounds.height);

?

5. portrait -> landscape

var appUIComponent:UIComponent = FlexGlobals.topLevelApplication as UIComponent;

var Width:Number = Math.ceil(appUIComponent.width / Capabilities.screenResolutionX * Capabilities.screenResolutionY);

var Height:Number = appUIComponent.width;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读