Is there a way to have the TileList component to auto-size to its contents? I have tried setting it 100%, but it seems that won't help. I don't want to hard-code the height because the content will be vary, and I don't want scrollbars to show up. Please help.
有没有办法让TileList组件自动调整其内容大小?我已经尝试将其设置为100%,但似乎无济于事。我不想硬编码高度,因为内容会有所不同,我不希望滚动条显示出来。请帮忙。
2 个解决方案
#1
This is how I ended up solving this issue: First I set the values for rowHeight and maxColumn properties. Then I did a little function that fires on the updateComplete event of the TileList to calculate the height of the tileList by doing a rowHeight * number of rows. That worked.
这就是我最终解决这个问题的方法:首先我设置rowHeight和maxColumn属性的值。然后我做了一个小函数,触发TileList的updateComplete事件,通过执行rowHeight *行数来计算tileList的高度。那很有效。
#2
Try creating an event handler when the tilelist changes, calculate the height based on the children then resize the child list based on that value.
尝试在tilelist更改时创建事件处理程序,根据子项计算高度,然后根据该值调整子列表的大小。
#1
This is how I ended up solving this issue: First I set the values for rowHeight and maxColumn properties. Then I did a little function that fires on the updateComplete event of the TileList to calculate the height of the tileList by doing a rowHeight * number of rows. That worked.
这就是我最终解决这个问题的方法:首先我设置rowHeight和maxColumn属性的值。然后我做了一个小函数,触发TileList的updateComplete事件,通过执行rowHeight *行数来计算tileList的高度。那很有效。
#2
Try creating an event handler when the tilelist changes, calculate the height based on the children then resize the child list based on that value.
尝试在tilelist更改时创建事件处理程序,根据子项计算高度,然后根据该值调整子列表的大小。