I have a ListView with quite "high" rows. The rows have quite complex layouts, and I'd like to get ListView to scroll to exactly a child element of a row. Is this possible?
I've only found .smoothScollToPosition(), but I can only specify a whole row in that. I need something more precise, to e.g. scroll to a child element in the middle of a row.
Thanks.
Take a look at the ListView method smoothScrollToPositionFromTop (inherited from AbsListView)
Smoothly scroll to the specified adapter position. The view will scroll such that the indicated position is displayed offset pixels from the top edge of the view. If this is impossible, (e.g. the offset would scroll the first or last item beyond the boundaries of the list) it will get as close as possible. The scroll will take duration milliseconds to complete.
You'll be responsible for calculating the offset required to land in the middle of a row - that is beyond the scope of your question as it stands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With