2020-09-29 10:39 PM
Now, the way I only know is to get the instance in virtual function "scrollList1UpdateItem" like this:
virtual void scrollList1UpdateItem(selection2& item, int16_t itemIndex)
{
item.setIcon(itemIndex);
}
Is there another way to get it from scrollList?
By the way, I see the ScrollList have a function named "getItem", the code of it like this:
int16_t getItem(int16_t drawableIndex)
{
return list.getItemIndex(drawableIndex);
}
Under what conditions will it be used?
Solved! Go to Solution.
2020-09-30 07:44 AM
Hello,
ScrollList and scrollwheel were not designed to be customized that much and are optimized for specific cases such as the ScrollWheel and ScrollList Example available in Designer.
scrollListUpdateItem() is the function that will interact with the items. There's no other simple way.
If you want to get the item easily, I would suggest instead to go for a ListLayout inside a Scrollable container.
The getItem() function will not be helpful because it will return only the index of the item in the list and not its instance.
/Alexandre
2020-09-30 07:44 AM
Hello,
ScrollList and scrollwheel were not designed to be customized that much and are optimized for specific cases such as the ScrollWheel and ScrollList Example available in Designer.
scrollListUpdateItem() is the function that will interact with the items. There's no other simple way.
If you want to get the item easily, I would suggest instead to go for a ListLayout inside a Scrollable container.
The getItem() function will not be helpful because it will return only the index of the item in the list and not its instance.
/Alexandre
2020-10-10 01:01 AM
Thank you for answering my questions.
2020-10-12 07:54 PM
And I have another question. what is the "Initial Selected Item" in ScrollWheel configuration?
2020-10-13 09:57 PM
As the name states, it specifies which item is selected first.
https://support.touchgfx.com/docs/development/ui-development/ui-components/containers/scroll-wheel/
/Alexandre