문제

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.

enter image description here

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top