关于获取Flex Mobile屏幕宽高
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; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |