[转]Tips on using&nbsp…

Tips on using the TileLayout in Flex 4.6


Posted on January 20, 2011 by Judah


Tips on using TileLayout in Flex 4.6. I had some difficulty in getting a tile layout to dynamically expand or contract the layout items. This post shows how I solved it.


To get the items in a TileLayout to expand to fill all the available space in a List or DataGroup container use the following settings:



<s:TileLayout id="tileLayout"
           horizontalGap="20"
           verticalGap="20"
           orientation="columns"
           requestedColumnCount="{columnCount}"
           rowAlign="justifyUsingHeight"
           columnAlign="justifyUsingWidth"
           rowHeight="{list.height / list.dataProvider.length}"
           />


The key is to set the rowHeight to minimum values based on the total number of items. In this case we are checking the list data provider and making sure the cell is at least that size.* In some cases it works fine without the rowHeight line???


When the columnAlign is set to ColumnAlign.JUSTIFY_USING_WIDTH the columnWidth actual value increases so that the last fully visible column right edge aligns with the container’s right edge. Note that explicitly setting the columnWidth property does not turn off justification. It only determines the initial column width value. Justification may increase it.


The columnCount is an integer with the value of 2. You can modify this value to fit your needs.


Note: To get all the contents of a layout item to use all available space set the verticalAlign and horizontalAligh to justify.


<s:TileLayout id="tileLayout"
           horizontalAlign="justify"
           verticalAlign="justify"
           />


Whenever you set the column count the layout will be updated and the layout items resized.


<s:List id="list"
      left="20"
      right="20"
      top="20"
      bottom="20"
      width="100%"
      height="100%"
      labelField="@label"
      selectedIndex="-1"
      contentBackgroundAlpha="0">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值