how to scroll an expandable list view till its end?

android, scroll

Solution

You need to use these parameters in your list view:

list.setTranscriptMode(ExpandableListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);

Set the head of the list to it bottom

list.setStackFromBottom(true);

You can also set in your xml

android:transcriptMode="alwaysScroll"

Problem

I made a class extending `ExpandableListView`. Following is the 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 I used it 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 also set its transcript mode `TRANSCRIPT_MODE_ALWAYS_SCROLL`. But its not scrolling till the end if i clicking on multiple items then the length increases and its hiding end items. I want something like this:

Original source