2013-04-19 11 views
5

私は簡単なアプリケーションを作成しました。私は辞書の単語を表示する展開可能リストビューを持っています。拡張リストビュー常に下にスクロールする問題

この拡張可能なリストビューはほとんど正常に機能しますが、単語のいずれかに触れると、 が下にスクロールします。どんな助けもありがとう。

これは私のXMLファイル

<?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> 

と、この私のJavaコードである...

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

答えて

9

このソリューションを試してみてくださいを参照してください。

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

ちょうどこの答えは非常に私にはフル助けているこのandroid:transcriptMode="normal"

+2

からandroid:transcriptMode="alwaysScroll"を交換してください。ありがとう。 – MukeshThakur

2

android:transcriptMode="alwaysScroll"これを使用した場合、リストは自動的になし、一番下までスクロールしますどのアイテムが現在表示されているかに関係します。その他のオプションについては

transcriptMode

関連する問題