2014-07-01 73 views
1

我需要一个TileLayout渲染元素,从下到上,从右到左。事情是这样的: examplebottom-top TileLayout

我设法欺骗TileLayout为“从右至左”的一部分,通过设置我的容器“的layoutDirection”属性“RTL”,但没有对等的垂直渲染。

<s:Group layoutDirection="rtl"> 
    <s:layout> 
     <s:TileLayout columnWidth="250" horizontalGap="8"/> 
    </s:layout> 

    <!-- etc -->  
    <s:Group id="fakeGroup3" layoutDirection="ltr"/> 
    <s:Group id="fakeGroup2" layoutDirection="ltr"/> 
    <s:Group id="fakeGroup1" layoutDirection="ltr"/> 

</s:Group> 

有没有简单的方法来实现这一目标?或者我应该重写TileLayout?!?

+0

我建议只是重写tilelayout或基于它创建自定义布局。 – StephenNYC

+0

这就是我所做的,最终。我不得不复制整个TileLayout代码来创建我自己的布局... 这篇文章是有帮助的:http://stackoverflow.com/questions/3089884/how-to-bottom-align-cells-in-a-datagroup-使用tilelayout – Octom

回答

0

您可以锚平铺布局组到页面底部:

<s:Group width="100%" height="100%" id="outermostLayoutContainer"> 
    <s:Group layoutDirection="rtl" width="100%" bottom="0"> 
     <s:layout> 
      <s:TileLayout columnWidth="250" horizontalGap="8"/> 
     </s:layout> 

     <!-- etc -->  
     <s:Group id="fakeGroup3" layoutDirection="ltr"/> 
     <s:Group id="fakeGroup2" layoutDirection="ltr"/> 
     <s:Group id="fakeGroup1" layoutDirection="ltr"/> 

    </s:Group> 
</s:Group> 

bottom="0"内集团将推动向基于其子屏幕的顶部。

+0

即使像这样,TileLayout将在将元素放入第二行之前填充第一行。 我需要的是填充**第一行底部**的布局,然后将多余的元素放在上面的行上。 – Octom

+0

您可以将''添加为'fakeGroup'元素列表中的第一个元素。那会有诀窍吗? – Brian

相关问题