简体   繁体   中英

How can I make a scroll view that clips to a scroll position in android?

I want to make a horizontal scrollview that clips to the closest scroll object, for example, if I have scroll objects 1,2,3 in the scrollview and the user stops scrolling between 1 and 2, the scrollview should jump to the closest object, is this possible in android?

You can do it with RecyclerView and SnapHelper.

Some good sample for it:

1- Using SnapHelper in RecyclerView

2- Detecting snap changes with Android's RecyclerView SnapHelper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM