开发者

How to make the list view scroll as my list item expand/collapse

I have a list view in android. And in each list item, user can expand/collapse when click on that list item. My question is how can I make the list view scroll to make the whole list item visible to user as I click the last item item which causes the last list item to expand and hence the list item increase its size (height)?

And same thing goes for when I click the list item to make the list item coll开发者_C百科apse (which makes it reduces its size)?

Thank you.


You could use:

listView1.smoothScrollToPosition(int position);

Or

listView1.smoothScrollByOffset(int offset);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜