cancel
Showing results for 
Search instead for 
Did you mean: 

how to scroll container scroll bar limit set?

ikassma
Senior

I am creating my menu using ListLayout Example of TouchGFX example code.

I want to set the Limit of the Scrollbar. But when I reviewed the current example and Class, I could not find that part.

How can I set Limit ?????

The end of the current list is similar to the one below, but I want to make the end of the list like the second one.

1st.0690X000008AQxAQAW.jpg

2nd.

0690X000008AQxOQAW.jpg

10 REPLIES 10
apll
Associate II

@ikassma​ do you resolve this problem?

no,i don't

ihsanoglu
Senior

same problem here :)

ihsanoglu
Senior

Its like the scrolling limit value is somehow set to the upper side of the container instead of the lower side

Martin KJELDSEN
Chief III

The height of the "list" member in the ListView example controls this behavior. Try, in your concrete view constructor, adding the following line:

list.setPosition(0, 0, 250, 50 /*Previously 250*/);

The list member of the object is in protected scope ... and cant be accessed form the view construcor ...

The concrete view uses public inheritance, so it should have access to the base class protected members. I have the example running here.

/Martin

ihsanoglu
Senior

Here is the answer for the question.

Simply use

setWindowSize()

From ScrollList Class.

If you have a list instance called myScrollList. And you want it to always display 5 items. You do this:

myScrollList.setWindowSize(5);

The default value is 1. So it will keep scrolling until there is 1 item displayed (Like the screenshot you shared). Set it to 5 and it won't scroll if less than 5 items are going to be visible.

setWindowSize() is a member in the ScrollList Class, not in the ListLayoutthough.

Is there a way to have the same effect of setWindowSize() in ListLayout?