cancel
Showing results for 
Search instead for 
Did you mean: 

Find index of first visible item in scrolllist

GMeta.1
Associate III

I am using a scrolllist that contains 6 items, 4 of which are visible. It is a horizontal list and non-circular. I'd like to have a couple of indicator items, one to the left and another to the right of the scrolllist to show whether there are items that are not currently visible. Maybe I'll even make these clickable and then auto-scroll left or right. I don't currently see a way to know what items are in view at the moment and someone has already asked this here:

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/how-to-get-index-of-first-visible-item-in-a-scrolllist/td-p/213644 

scrollList2UpdateItem() doesn't do anything useful here because it just tells you that you need to update something that is shortly going to be visible.

 

1 REPLY 1
LouisB
ST Employee

Hello @GMeta.1,

You can use UpdateItem(), it gives you which element will appear. With this information you know which element are visible are not.
So depending on which value is calling UpdateItem you will either show or hide indicators.
You can check the scroll list/ scroll wheel example to see how this function is called.

BR,
Louis B.

Louis BOUDO
ST Software Engineer | TouchGFX