o19830015 于 2013.04.19 13:24 提问
- listView自动滚动到底部
-
求助,程序中折叠的listView出现问题。
这个listView是显示词典单词的,并且可以折叠。唯一的问题是每次触摸到其中的单词,list就会滚动到底部。
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);
-
- franzhong 2013.04.19 14:05
- 已采纳
把这个去掉
android:transcriptMode="alwaysScroll"
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
- 其他相关推荐