cancel
Showing results for 
Search instead for 
Did you mean: 

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

BParh.1
Senior III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
BParh.1
Senior III

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

View solution in original post

3 REPLIES 3
MM..1
Chief II

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
Senior III

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
Senior III

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.