Skip to main content
BParh.1
Senior III
August 4, 2021
Solved

There is discrepancy between the item number stated in TouchGFX designer vs generated code

  • August 4, 2021
  • 3 replies
  • 986 views

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?

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

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()

3 replies

MM..1
Super User
August 5, 2021

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 ...

BParh.1
BParh.1AuthorBest answer
Senior III
August 6, 2021

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()

BParh.1
BParh.1Author
Senior III
August 6, 2021

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.