444 views
in GUI Development by
Hello,

I have implemented a horizontal list. Each item displays a text.

Over the list are two slide touch handlers, one for scrolling horizontally, the other one for vertical scrolling, if the text is too long.

This works very nice, with one exception:
When I scroll horizontally, always two items of the list are loaded (onLoadItem is called twice). It seems, that some component stores the item, which might be loaded next for optimization. However, this optimization is a problem for me, because in the onLoadItem method I want to update a vertical scroll bar. This is not possible, because the funtion has already been called for the next item to be displayed.

1 Answer

0 votes
by
 
Best answer

Hello,

in order to load an item, the Horizontal List sends a signal to a slot method stored in its property OnLoadItem. This slot method (your onLoadItem) has then the job to obtain the data associated with the requested item (from your data storage, data base, etc.) and to initialize the corresponding item view so it reflects this information. Due to a caching mechanism, which helps to make smooth scrolling, the list loads a few more items which are currently not visible.

To adjust your vertical scrollbar (I assume it is not within each item of the horizontal list) you can register your own OnUpdate slot method of the horizontal list. Please have a look to the section 'arrange other views on the content of the Horizontal List'.

Best regards,

Manfred Schweyer.

by
Thank you very much. Works perfectly.

Embedded Wizard Website | Privacy Policy | Imprint

...