2021-08-04 04:21 PM
So I setup a scroll list containing 6 items from particular template.
But the generated code show the number of items is 8. Although when run, the simulator show 6 templates. This cause some logic error when need to do decision based on items count.
touchgfx::DrawableListItems<StatisticsItem, 8> ListListItems;
On snippet above, it shows 8 count, while I setup 6. Is this a bug?
Solved! Go to Solution.
2021-08-05 06:20 PM
Thank you @MM..1 , so what API I should use to get the true item list count (e.g. 6). Currently I am using getNumberOfDrawables()
2021-08-05 12:31 AM
No count for drawable have dimension caalculated from list area and one item size + 2
You can change count in code and gui is prepared for this.
And when you change for example to 100 items list , visible drawable stay 8 ...
2021-08-05 06:20 PM
Thank you @MM..1 , so what API I should use to get the true item list count (e.g. 6). Currently I am using getNumberOfDrawables()
2021-08-05 06:31 PM
OK I think I misunderstood the API, to get the list count we need to use method from touchgfx::ScrollList class not touchgfx::DrawableListItems. The API is
getNumberOfItems().
I tested this and behave as what I expected.