Skip to main content
RReta.1
Associate II
June 2, 2021
Solved

ScrollList can only host 6 items?

  • June 2, 2021
  • 2 replies
  • 936 views

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?

This topic has been closed for replies.
Best answer by MM..1

Items count in memory is based on viewed on screen count + 2 for scrolling. NumberofItems can be 100 or changing on the fly...

2 replies

MM..1
MM..1Best answer
Super User
June 2, 2021

Items count in memory is based on viewed on screen count + 2 for scrolling. NumberofItems can be 100 or changing on the fly...

RReta.1
RReta.1Author
Associate II
June 3, 2021

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.