我想在 LazyColumn 上实现“类似 iOS”的反弹效果,但不知道如何实现它。
预期结果是:类似于 Android 上的 iOS 滚动效果(使用 RecyclerView),列表顶部和底部有弹跳。
我浏览了 Chris Bane 的 snapper: https: //github.com/chrisbanes/snapper但它似乎不支持它。
我的猜测是我需要创建一些 LazyListScope 扩展,但很难弄清楚。
先感谢您!
我想在我的应用程序中实现类似iOS的反弹过度滚动效果.
我遇到了这个链接,建议创建一个自定义ScrollView.但问题是,当我快速上下滚动它工作正常但是一旦我拉动屏幕的底部或顶部它就会卡住而且效果不再起作用.
作为我想要实现的那种动画的一个例子,你可以看看这个:

这是我目前的代码:
public class ObservableScrollView extends ScrollView
{
private static final int MAX_Y_OVERSCROLL_DISTANCE = 150;
private Context mContext;
private int mMaxYOverscrollDistance;
public ObservableScrollView(Context context)
{
super(context);
mContext = context;
initBounceScrollView();
}
public ObservableScrollView(Context context, AttributeSet attrs)
{
super(context, attrs);
mContext = context;
initBounceScrollView();
}
public ObservableScrollView(Context context, AttributeSet attrs, int defStyle)
{
super(context, attrs, defStyle);
mContext = context;
initBounceScrollView();
}
private void initBounceScrollView()
{
//get the density of the screen and do some maths …Run Code Online (Sandbox Code Playgroud)