Advanced list view. Always scroll to the bottom.

I created a simple application, I have an extended list that displays dictionary words.

This extended list view works almost right, but when I touch any word, It scrolls down. Any help would be appreciated.

This is my xml file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:id="@+id/dicrellis"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">

        <ExpandableListView
            android:id="@+id/expandable_list"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:cacheColorHint="#00000000"           
            android:transcriptMode="alwaysScroll"/>

    </RelativeLayout>

</RelativeLayout>

, and this is my Java code ...

mExpandableList = (ExpandableListView)findViewById(R.id.expandable_list);
mExpandableList.setAdapter(new MyCustomAdapter(Dictionary.this,arrayParents));
mExpandableList.setOnItemClickListener(this);
+5
source share
2 answers

Try this solution.

  <ExpandableListView
  android:id="@+id/expandable_list"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:cacheColorHint="#00000000"           
  android:transcriptMode="normal"/>

Just replace android:transcriptMode="alwaysScroll"itandroid:transcriptMode="normal"

+9
source

android:transcriptMode="alwaysScroll" when using this list, it will automatically scroll to the bottom, regardless of which items are currently visible.

For other options see transcriptMode

+2
source

All Articles