2021-06-02 12:29 PM
version: touchGFX Designer 4.16.1
I generated a ScrollList to contain 8 items
In the .touchGFX project (attached) I can see the expected lines
"Type": "ScrollList",
"PaddingBefore": 0,
"PaddingAfter": 0,
"Snapping": false,
"IsHorizontal": false,
"IsCircular": false,
"ItemTemplateName": "lightSliderGroup",
"NumberofItems": 8,
However in the base class of the generated code I see this:
touchgfx::ScrollList lightGroupList;
touchgfx::DrawableListItems<lightSliderGroup, 6> lightGroupListListItems;
The odd thing is that 8 items actually got created, however in my case the slider value of the last 2 items always follow the value of the first 2 items in the list?
Hacking that line to change it from 6 to 8 does not fix the issue either.
Am I missing something or is this a bug? If so, is there any workaround?
Solved! Go to Solution.
2021-06-02 12:40 PM
Items count in memory is based on viewed on screen count + 2 for scrolling. NumberofItems can be 100 or changing on the fly...
2021-06-02 12:40 PM
Items count in memory is based on viewed on screen count + 2 for scrolling. NumberofItems can be 100 or changing on the fly...
2021-06-03 01:21 PM
Thanks MM!
For everyone else, adding tracer prints around the ListUpdateItem in your view helps clarify the comment. In my case, the scroll list starts with 8 items, but only 4 is visible on the screen at a given time, which is why the `getNumberOfDrawables` is set to 6 (4+2) in my case.
As for the slider values being odd in my question, it was a case of uninitialized slider bar values. Once I do initialize them to known values, all is good.