LWUIT & Codename One both have a snap to grid property in Container and in List. Did you activate it? Just use setSnapToGrid(true)
on any component.
LWUIT(J2ME) List snapping elements to grid after scrolling
-
01-07-2022 - |
Question
Essentially what I want to happen is, after the user scrolls the list, I want the elements to snap into 'grids' instead of remaining where they are, so that I can center the middle component in the list, like in the picture.
I tried manually changing the setSelectedIndex after setting ScrollToSelected to true, but that lacks any animation, and the list scrolls the element to the edge of the screen, rather than the middle.
How can I have the effect of scrolling the element with animation, and to the middle of the screen?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow