Android的ListView,数据更新后自动scroll到底部。
16lz
2021-01-23
在ListView的layout配置中添加 android:transcriptMode="alwaysScroll",
或者在Java代码中执行 lv.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
<ListView android:id="@+id/id_listView_contact" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:transcriptMode="alwaysScroll" </ListView>
参考:http://stackoverflow.com/questions/3606530/listview-scroll-to-the-end-of-the-list-after-updating-the-list
更多相关文章
- Android 代码设置Color的几种方式
- android studio 格式化代码时注解不换行
- android 使用Intent传递对象 Serializable 或者 Parcelabel 《第
- material design 的android开源代码整理
- Android Studio代码混淆,开启Proguard,稍微总结一下
- android查询软件(身份证号,号码归属等)源代码