今天忽然想到很久之前孙哥曾给我提的一个需求,涉及到android:transcriptMode这个属性。 就想查找下前辈分享的学习成果资料,没有找到。于是就想把我学习成果分享给大家。
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. 数据变化,就会滚动到底部。 |
在xml中 android:transcriptMode=“alwaysScroll”
在java中 listview.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);