android - how to scroll an expandable list view till its end? -
i made class extending expandablelistview
. following code :
class customexpandablelistview extends expandablelistview { public customexpandablelistview(context context) { super(context); } protected void onmeasure(int widthmeasurespec, int heightmeasurespec) { /* * adjust height */ heightmeasurespec = measurespec.makemeasurespec( 700, measurespec.at_most); super.onmeasure(widthmeasurespec, heightmeasurespec); } }
and used as.
expandablelistview list = new customexpandablelistview(kaasmain.this); adapter adapter = new adapter(kaasmain.this, objectslvl1); list.setadapter(adapter); parent.addview(list); // list.setgroupindicator(); list.settranscriptmode(expandablelistview.transcript_mode_always_scroll); list.setindicatorbounds(0, 0); list.setchildindicatorbounds(0, 0);
i set transcript mode transcript_mode_always_scroll
. not scrolling till end if clicking on multiple items length increases , hiding end items. want this:
you need use these parameters in list view:
list.settranscriptmode(expandablelistview.transcript_mode_always_scroll);
set head of list bottom
list.setstackfrombottom(true);
you can set in xml
android:transcriptmode="alwaysscroll"
Comments
Post a Comment