StickyListHeaders icon indicating copy to clipboard operation
StickyListHeaders copied to clipboard

Programmatically scroll to section header

Open codyrotwein opened this issue 10 years ago • 6 comments

Is there any way to programmatically scroll to a particular section header? I have buttons along the top of my ListView which represent the different section headers, and I want to scroll to the appropriate section upon tapping them. Is this possible?

codyrotwein avatar Jan 07 '15 21:01 codyrotwein

I'm also looking for something similar to that. I've tried using "setSelection" without success

list.post(new Runnable() { @Override public void run() { list.setSelection(pos); list.clearFocus(); } });

lucasjotab3 avatar Jan 13 '15 13:01 lucasjotab3

+1! I want to use it when clicking an header in the expandable version!

lorenzos avatar Jul 02 '15 15:07 lorenzos

Where you able to do it?

pinhassi avatar May 04 '16 10:05 pinhassi

I ended up having to calculate the index/position for each header and use ListView's setSelection() method.

codyrotwein avatar May 04 '16 13:05 codyrotwein

@codyrotwein how did you calculate the index/position for each header ?

SiddarthG avatar Jun 02 '16 07:06 SiddarthG

Would smoothScrollToPositionFromTop be something you're looking for?

rks92 avatar Nov 29 '16 00:11 rks92