MukeshThakur
MukeshThakur

Reputation: 452

Expandeble list view Always scroll to bottom issue

I created simple Application, I have Expandable List View which display the dictionary words.

This Expandable list view works almost properly but when I touch to any of the word, It scrolls to bottom. Any help will 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 my java Code...

mExpandableList = (ExpandableListView)findViewById(R.id.expandable_list);
mExpandableList.setAdapter(new MyCustomAdapter(Dictionary.this,arrayParents));
mExpandableList.setOnItemClickListener(this);

Upvotes: 5

Views: 1403

Answers (2)

Alpan
Alpan

Reputation: 518

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" from this android:transcriptMode="normal"

Upvotes: 9

Arun C
Arun C

Reputation: 9035

android:transcriptMode="alwaysScroll"when using this, the list will automatically scroll to the bottom, no matter what items are currently visible.

For other options see transcriptMode

Upvotes: 2

Related Questions