0

My ListView has children which are of varying height.

As a result smoothScrollToPosition often scrolls to an incorrect position!

Is there any way I can achieve a smooth scroll to a position with my constraints? I've tried using a ValueAnimator in combination with setSelection() but it looks quite jumpy.

Nyx
  • 2,233
  • 1
  • 12
  • 25
  • Can you show some of your code? Maybe your `ListView` xml and/or your `getView()`? – codeMagic Jun 13 '14 at 23:29
  • I'm not sure if the code will actually help you, the biggest issue is that there is a one of the views in the child element is a TextView that can be anywhere from 1-4 lines. If I fix the height of the of TextView, then my smoothScrollToPosition works flawlessly. – Nyx Jun 13 '14 at 23:38
  • Do you have children content changing dynamically as well? - if so call notifydatasetchanged before calling smoothSCrollToPosition – sihrc Jun 14 '14 at 00:34
  • If that doesn't work, you can always manually grab the distance. parent.getChildAt().getTop()/getLeft() – sihrc Jun 14 '14 at 00:39
  • @sihrc I do indeed, I have an AsyncTask that determines the text to display in the TextView. – Nyx Jun 14 '14 at 00:59
  • Have you tried this approach? http://stackoverflow.com/a/17473283/82788 – matiash Jun 14 '14 at 02:59

0 Answers0