我想滚动我的RecyclerView
到offset
的特定位置。现在我正在使用scrollToPositionWithOffset(position, offset)
并且此方法可以正常工作,除非滚动发生得太快,而且我无法控制滚动的速度。我试过使用smoothScrollToPosition()
,但我需要偏移量。有人能告诉我如何在使用scrollToPositionWithOffset()
时控制滚动速度?RecyclerView带偏移量的滚动速度
1
A
回答
-1
把你的recyclerview
放在nestedScrollview
它会顺利滚动。
1
如果您需要控制投掷速度,则需要实施自己的回收器视图实现。
public class CustomRecyclerView extends RecyclerView {
Context context;
public CustomRecyclerView(Context context) {
super(context);
this.context = context;
}
public CustomRecyclerView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomRecyclerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean fling(int velocityX, int velocityY) {
velocityY *= 0.7;
// velocityX *= 0.7; for Horizontal recycler view. comment velocityY line not require for Horizontal Mode.
return super.fling(velocityX, velocityY);
}
}
相关问题
- 1. jQuery的滚动偏移量
- 2. 如何计算RecyclerView的滚动速度
- 3. UITableView headerView滚动偏移量
- 4. 带加速度计的移动/滚动球
- 5. 带偏移量的单元格滚动百分比
- 6. 画布window.inner(宽度|高度)滚动条偏移量?
- 7. 带滚动条的RecyclerView
- 8. 滚动速度自动滚动速度
- 9. RichTextBlock滚动到指定的偏移量
- 10. 的UIScrollView不滚动偏移量
- 11. 100%高度表重置滚动偏移
- 12. R:矩阵上的绝对滚动偏差(带偏移1)
- 13. 带偏移量的TFileStream
- 14. 带偏移量的VBA宏
- 15. UIViewController:extendedLayoutIncludesOpaqueBars和滚动视图偏移量
- 16. 添加带偏移量的张量
- 17. Recyclerview快速滚动的物品消失
- 18. 矢量角度偏移
- 19. 带滚动的移动div
- 20. 快速移动后漂移偏航角
- 21. Python滚动速度
- 22. jquery滚动速度?
- 23. UITableView滚动速度
- 24. 带分页的UIScrollView的灵敏度/滚动速度
- 25. 带偏移量的日期的DateTime ParseException
- 26. 在Android中快速滚动RecyclerView
- 27. 在RecyclerView中成倍增加滚动速度? (耐磨)
- 28. 如何补偿具有不同偏移量的动画的速度?
- 29. 设置动态扩展滚动视图的内容偏移量
- 30. 带偏移量的结构指针
哇......我的工作一切都很顺利,请问您能告诉我您是如何使用它的? *好奇* –
尽管这可能会回答这个问题,但提供关于_how_和/或_why_的附加[上下文](https://meta.stackexchange.com/q/114762)可以解决问题,从而提高答案的长期价值。请记住,你正在为将来的读者回答这个问题,而不仅仅是现在问的人!请[编辑](http://stackoverflow.com/posts/43255822/edit)您的答案添加一个解释,并指出适用的限制和假设。它也不会提到为什么这个答案比别人更合适。 –