ListView第一次加载的时候自动滚动到底部,滑动的时候新增数据时不会跳转至底部

本文详细介绍了ListView中transcriptMode属性的几种设置方式及其效果:disabled为默认禁用状态;normal模式下,数据集变更时若最后一项已显示则自动滚动至底部;alwaysScroll模式则无论当前视图状态如何都会自动滚动至底部。此外还提到了实现自动滚动至底部所需的两个属性配置。

 transcriptMode  的值

disabled 0 Disables transcript mode. This is the default value. 
默认的,transcriptMode不可用。
normal 1 The list will automatically scroll to the bottom when a data set change notification is received and only if the last item is already visible on screen.
当数据变化,并且,最后一条可见的时候,会自动滚动到底部。
alwaysScroll  2 The list will automatically scroll to the bottom, no matter what items are currently visible.
数据变化,就会滚动到底部。

使ListView滚动到底部

android:stackFromBottom="true"

android:transcriptMode="normal"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值