1 Reply Latest reply on Jan 19, 2011 6:13 PM by Lee Burrows

    ViewStack width

    SiHoop Level 1

      In the following code, I place an image into a Canvas. The Canvas is inside a ViewSatck. The idea is that the image should expand to the full width of the screen. However, it only expands to the width of the ViewStack.

      My problem is that I do not understand why the ViewStack does not take up the full width of the stage. You will see when it runs that there is a red border around the ViewStack. Why is there a gap of approximately 10 pixels between the ViewStack and the stage and how do I get rid of it without entering an absolute value?

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" >
          <mx:ViewStack  width="100%" height="100%" borderThickness="2" borderColor="0xff0000" borderStyle="solid" >
              <mx:Canvas  width="100%" height="100%" verticalCenter="0" horizontalCenter="0" >
                  <mx:Image  source="panel.png"  horizontalCenter="0" verticalCenter="0"  width="100%" maintainAspectRatio="false"/>
              </mx:Canvas>
          </mx:ViewStack>
      </mx:Application>