如何适应Flex AIR应用程序以全屏幕? [英] How to fit a Flex Air application to Full Screen?
问题描述
我有一个AIR应用程序中的Flex专为1280×800,我想伸展到工作全屏幕1920x1200的显示器上。
I have an Air Application in Flex designed for 1280x800 which I would like to stretch to work full screen on a 1920x1200 monitor.
我读过这篇文章:的http://博客.adobe.com / aharui / 2008/01 / flex_and_scalemodes.html 并尝试过,但它只是放大的左上角(如文中提到的)。
I've read this article: http://blogs.adobe.com/aharui/2008/01/flex_and_scalemodes.html and tried it, but it only zooms the upper left corner (as mentioned in the article).
我用的WindowedApplication(如下所示),其保持视图(称为马西德威),它包含所有不同布局设计元件工作。
I work with a WindowedApplication (shown below) which holds a View (called MasterView) that contains all different lay-out elements.
有什么建议?
我的(简述)应用程序是这样的:
My application (in brief) looks like this:
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
width="100%" height="100%"
horizontalScrollPolicy="off"
verticalScrollPolicy="off"
clipContent="false"
windowComplete="goFullscreen()"
>
private function goFullscreen():void
{
Mouse.hide();
this.stage.scaleMode = StageScaleMode.EXACT_FIT;
this.stage.align = StageAlign.TOP_LEFT;
this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
try
{
showStatusBar = false;
removeChild(statusBar);
}
catch (err:Error)
{ }
root.stage.addEventListener(KeyboardEvent.KEY_DOWN, switchFullScreen)
}
</mx:WindowedApplication>
谢谢, 加布
Thanks, Gab
推荐答案
最后,我们找到了最好的解决方法是手动设置缩放比例。因此,通过确定屏幕/视口的宽度,并找出如何,可扩展到我们的应用程序的大小,我们解决了这个问题。
Finally we found out the best solution is to manually set the scaling ratio. So by determining the width of the screen/viewport and finding out how that scales to the size of our application we resolved this issue.
这篇关于如何适应Flex AIR应用程序以全屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!