Manel
Manel

Reputation: 147

Flex/AIR: To resize all components inside a WindowedApplication

It's interesting. If you set stage.scaleMode = StageScaleMode.EXACT_FIT; all components are resized when you resize the window, BUT there is a grey stripe at the bottom of the window that is not.

What does that mean?

By the way, is it possible to take that grey line/stripe off from the window?

Try to resize this window and you'll see what happens:

<?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>

There is also a timer just for checking if the Stage's size is the same as the application window's one.

Upvotes: 1

Views: 977

Answers (2)

J_A_X
J_A_X

Reputation: 12847

That grey stripe at the bottom is the statusbar from the windows chrome, you need to set the 'systemChrome' tag to false in the app xml descriptor file to remove it or do showStatusBar="false".

Upvotes: 0

elekwent
elekwent

Reputation: 773

The gray stripe is the statusBar property of the WindowedApplication class. Turn it off by setting showStatusBar="false" inside the WindowedApplication tag.

Upvotes: 1

Related Questions