Table-like List (類似表格的List)
List displays scrollbar if containing too many items. What if we just need it expand as high as possible no matter how many items here? Some solutions are available :
If variableRowHeight is false, please assign explicit height as number of height multiplies rowHeight, as following code:
height = rowHeight * IList(dataProvider).length
Otherwise, if you get variableRowHeigh ture, there is a handy function for you:
measureHeightOfItems(0,0);
Please see List#measureHeightOfItems() for more information.
要讓List元件自己長到顯示所有資料的高度,像是表格一樣,有以下方法:
如果variableRowHeight 為 true , 表示每個資料物件所需欄高不同,可以用 List#measureHeightOfItems(index,count); 得出總高度。 反之,欄高都相同的情況,只要把欄高乘於資料數,得出總高就是了。
height = rowHeight * IList(dataProvider).length ;
