2020-07-14 08:58 AM
When adding elements to a ListLayout(which is configured to scroll vertically "SOUTH"), the newest elements is added to the bottom, which is fine. However, what is constantly remaining on the top of the view is the first(oldest) element and the subsequent older. As such, the content is larger than the height, the newest element will be hidden till manually scrolling the list.
Is there a way to make the list automatically updates "i.e. scrolls up" such that the newest element is in view?
Solved! Go to Solution.
2020-07-15 04:52 AM
Hello,
I guess you encapsulated your List Layout inside a Scrollable Container.
In this setup, you can use moveChildrenRelative() to move the List Layout inside the Scrollable container accordingly.
void ScrollableContainer::moveChildrenRelative(int16_t deltaX, int16_t deltaY)
/Alexandre
2020-07-15 04:52 AM
Hello,
I guess you encapsulated your List Layout inside a Scrollable Container.
In this setup, you can use moveChildrenRelative() to move the List Layout inside the Scrollable container accordingly.
void ScrollableContainer::moveChildrenRelative(int16_t deltaX, int16_t deltaY)
/Alexandre
2020-07-15 12:08 PM
@Alexandre RENOUX
Thank you so much, with some manipulations and adjustments, that works very well. Appreciated!
2020-07-16 03:04 PM
@Alexandre RENOUX My next question would be: For ListLayout, how to implement an equivalent to setWindowSize() in ScollList? I mean, how to implement a way to stop scrolling when reaching the last element of the ListLayout?
(Yes, I have the ListLayout inside a scollable container. )
2020-07-20 03:40 AM
Hello,
It's supposed to do it automatically.
I suppose that you are looking at the ListLayout Example because this example has a bug that you can fix by adding the following line at the beginning of void Screen1View::setupScreen() :
void Screen1View::setupScreen()
{
list.setPosition(0, 0, 0, 0);
// ... The rest of the code
}
/Alexandre
2020-07-21 06:03 AM
That helped, thanks