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);
4

2 に答える 2

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="alwaysScroll"ここから交換するだけandroid:transcriptMode="normal"

于 2013-04-19T04:48:05.113 に答える
2

android:transcriptMode="alwaysScroll"これを使用すると、現在表示されている項目に関係なく、リストは自動的に一番下までスクロールします。

その他のオプションについては、transcriptModeを参照してください。

于 2013-04-19T04:43:59.187 に答える