【问题标题】:Flex 4's HSlider and TileLayout resizing problemFlex 4 的 HSlider 和 TileLayout 调整大小问题
【发布时间】:2010-09-13 16:45:34
【问题描述】:

我有一个简单的应用程序,它由一个 HSlider 和一个列表组成,该列表包含一个项目渲染器和一个由平铺布局管理的边框容器。由于某种原因,当移动滑块以减小项目渲染器的大小时,它只会减小到一定大小,并且不会进一步减小。我在 flex 3 中使用了相同的原理(使用 mx 组件可以正常工作)。知道我在这里做错了什么吗?

这是应用程序 mxml:

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

<s:HSlider id="thumbSize" layoutDirection="ltr" snapInterval=".25" showDataTip="true" minimum=".8" maximum="2" value="2" liveDragging="true"/>

<s:List id="photosList"
        itemRenderer="ImageRender"
        horizontalCenter="0" verticalCenter="14" width="100%" height="90%" borderAlpha="0" selectionColor="white" allowMultipleSelection="true" rollOverColor="white">
    <s:layout>
        <s:TileLayout columnWidth="{80*thumbSize.value}" rowHeight="{79.5*thumbSize.value}" horizontalGap="0" useVirtualLayout="true"/>
    </s:layout>
    <s:dataProvider>
        <s:ArrayList>
            <fx:Object/>
            <fx:Object/>
            <fx:Object/>
            <fx:Object/>

        </s:ArrayList>
    </s:dataProvider>
</s:List>
</s:Application>

对于项目渲染器:

<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark" 
            xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:BorderContainer  cornerRadius="19" top="0" bottom="0" left="0" right="0" borderAlpha="1" borderWeight="3" borderColor="0xc0c0c0"  backgroundColor="0xD3D3D3"  >
    <mx:Image id="img" top="5" bottom="20" right="5" left="5" horizontalAlign="center" verticalAlign="middle" source="http://xmxsolutions.com/images/flex_logo.jpg"  maintainAspectRatio="true"/>
</s:BorderContainer>
</s:ItemRenderer>

这应该适用于任何 flex 4 应用程序。

感谢任何人都可以给我的任何指示

【问题讨论】:

    标签: apache-flex flex4


    【解决方案1】:

    根据文档,BorderContainer 的最小尺寸为 112 像素宽 x 112 像素高。

    我怀疑可以通过设置explicitMinWidth 和explicitMinHeight 或measuredMinWidth 或measuredMinHeight 使它们更小。但我也没有测试过。 minHeight 和 minWidth 可能会发挥作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-27
      • 2012-04-19
      • 1970-01-01
      • 2011-05-22
      • 2010-10-21
      • 1970-01-01
      • 1970-01-01
      • 2011-06-25
      相关资源
      最近更新 更多