这很有趣。如果设置stage.scaleMode = StageScaleMode.EXACT_FIT;
,则在调整窗口大小时会调整所有组件的大小,但是窗口底部有一个灰色条纹,而不是。
这是什么意思?
顺便说一下,是否可以从窗口中取出灰线/条纹?
尝试调整此窗口的大小,您将看到会发生什么:
<?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*"
applicationComplete="initApplication(event)" width="800" height="600" preloaderChromeColor="#FFFCFC">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
private function initApplication( evt:FlexEvent):void{
stage.scaleMode = StageScaleMode.EXACT_FIT;
var timer:Timer = new Timer(3000);
timer.addEventListener( TimerEvent.TIMER, onTimer );
timer.start();
}
private function onTimer( evt:TimerEvent ):void{
this.width = 600;
trace(this.stage.stageWidth, this.stage.stageHeight);
}
]]>
</fx:Script>
<s:Button x="185" y="245" label="Button" width="112" height="61"/>
</s:WindowedApplication>
还有一个计时器,用于检查舞台的大小是否与应用程序窗口的大小相同。
答案 0 :(得分:1)
灰色条纹是WindowedApplication类的statusBar属性。通过在WindowedApplication标记内设置showStatusBar="false"
来关闭它。
答案 1 :(得分:0)
底部的灰色条纹是windows chrome中的状态栏,您需要在app xml描述符文件中将'systemChrome'标记设置为false以将其删除或执行showStatusBar =“false”。