Apache flex Flex mx:图像适配屏幕

Apache flex Flex mx:图像适配屏幕,apache-flex,Apache Flex,我有一些带有图像的布局,我希望该布局自动适应屏幕(这就是为什么我使用100%),但当我加载大图像时,它超出了屏幕范围(实际上我可以设置mx:image maxHeight=“”,但对于不同的屏幕分辨率,该值不相同) 我的布局示例: <s:VGroup> <s:BorderContainer borderStyle="solid" width="100%" height="100%> <s:

我有一些带有图像的布局,我希望该布局自动适应屏幕(这就是为什么我使用100%),但当我加载大图像时,它超出了屏幕范围(实际上我可以设置mx:image maxHeight=“”,但对于不同的屏幕分辨率,该值不相同)

我的布局示例:

    <s:VGroup>              
        <s:BorderContainer borderStyle="solid"  width="100%" height="100%>
            <s:Scroller left="2" right="2" top="2" bottom="2">
                <s:Group id="group"> 
                    <mx:Image id="currImg" />
                </s:Group>
            </s:Scroller>   
        </s:BorderContainer>
         <!-- .....  -->
        </s:VGroup>


假设您希望
图像
与您的应用程序大小相同(并且假设您使用的是Flex 4),您可以使用:

maxHeight=“{FlexGlobals.topLevelApplication.height}”


这会将图像的最大高度设置为与应用程序相同的高度。

如果您希望图像的大小与应用程序的大小相同(并且假设您使用的是Flex 4),则可以使用:

maxHeight=“{FlexGlobals.topLevelApplication.height}”


这会将图像的最大高度设置为与应用程序相同的高度。

您需要将所有容器的高度/宽度设置为100%

<s:VGroup width="100%" height="100%">              
   <s:BorderContainer borderStyle="solid"  width="100%" height="100%">
      <s:Scroller left="2" right="2" top="2" bottom="2">

                    <mx:Image id="currImg" width="100%" height="100%" scaleContent="true" />
      </s:Scroller>   
   </s:BorderContainer>
</s:VGroup>

您需要将所有容器的高度/宽度设置为100%

<s:VGroup width="100%" height="100%">              
   <s:BorderContainer borderStyle="solid"  width="100%" height="100%">
      <s:Scroller left="2" right="2" top="2" bottom="2">

                    <mx:Image id="currImg" width="100%" height="100%" scaleContent="true" />
      </s:Scroller>   
   </s:BorderContainer>
</s:VGroup>