我确实知道如何使用 LinearManager 从 RecyclerView 获取可见项并计算它是否完整显示。
This picture the yellow item showing some part don't count it as showing.
This picture the yellow item showing entirety count it as showing.
我的想法是
- 黄色项目像素的顶部/底部位置不在屏幕范围内,则视为未显示。
- 显示黄色项目之前/之后的其他项目算作显示。
任何人都有任何想法。
最佳答案
使用以下方法
LinearLayoutManager.findFirstCompletelyVisibleItemPosition() LinearLayoutManager.findLastCompletelyVisibleItemPosition()
https://developer.android.com/reference/android/support/v7/widget/LinearLayoutManager.html
关于android - 我怎么知道 RecyclerView 的项目显示完整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38530190/