layoutmanager.FindFirstCompletelyVisibleItemPosition always returns -1

廉价感情. 提交于 2019-12-04 05:08:57

layoutManager.findFirstCompletelyVisibleItemPosition()

FROM DOCUMENT

Returns the adapter position of the FIRST FULLY VISIBLE view. This position does not include adapter changes that were dispatched after the last layout pass.

It mean that, at least one listitem view should be fully visible otherwise, it give -1 (NO_POSITION)

FROM TESTING

This will work and give correct position...

This won't work and give -1 (NO_POSITION), because two ListItem view is not fully visible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!