问题
Actually i am implementing a recyclerview in android now i am facing a problem that when i do pagination(scrolling) then i want to scroll the user to the exact position where user was before pagination but what happens is that when i use scrollto() method it scroll to some pixels above or sometimes some pixels beow but not at the exact position.
As in order to restructure my problem i want to ask is, is there any possible way by which i can check how many pixel down was the user at any position, because for example user can be somewhere between the 10 and 11 but i will scroll him to 10 or 11 but i want to scroll him at exact between 10 and 11 where he was can anyone please enlighten me i am trying so hard but i am not able to figure it out how to do this.
Thank you in Advance.
回答1:
Your question is somehow not clear but try to cover it up,
You should use:
LinearLayoutManager.scrollToPositionWithOffset(int, int)
This will scroll your view to the specific position.
来源:https://stackoverflow.com/questions/32321952/how-to-scroll-the-user-at-the-exact-position-which-is-somewhere-between-two-vie