Is it possible for a Flex List
to adjust its height automatically for the number of rows it's displaying? The problem I'm having is that the List renders taller than the number rows. The number of rows is dynamic so I'd like the List to automatically adjust its height based on its content. I've tried setting height="100%"
which doesn't help.
views:
33answers:
2
A:
If your items all render at the same height, you could bind the height of your list to the number of rows * the item renderer height.
Alternatively, if you are using Flex 4, you can create new skin for your List based on the existing List skin, but remove the Scroller that wraps the DataGroup and make the height of the DataGroup 100%.
Hope that helps.
Wade Mueller
2010-08-19 22:36:28
Unfortunately each row's height is different.
Steve Kuo
2010-08-19 22:44:57
Are you using a Flex 4 (spark) List? If so, you may want to try modifying the default skin as I describe above. Also, you may need to change useVirtualLayout to false.
Wade Mueller
2010-08-19 22:52:21
I thought that the Flex 4 List had this behavior out of the box.
James Ward
2010-08-19 23:08:48
A:
It appears that List
defaults to fixed row height. Setting variableRowHeight
to true fixed it.
variableRowHeight="true"
Steve Kuo
2010-08-25 00:03:12