stackFromBottom-listview 内容从底部开始填充

今天遇到了一个问题,就是listview虽然占满了整个屏幕,但是,当它的内容只有几条的时候,它会从底部开始显示,上面留有空白。后来进入xml发现,listview有个属性stackFromBottom,就是它决定了listview内容填充方式

 <view class="com.android.mms.ui.MessageListView"
            style="?android:attr/listViewWhiteStyle"
            android:id="@+id/history"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="1.0"
            android:smoothScrollbar="true"
           <!--默认为false--
            android:stackFromBottom="false"
            android:visibility="gone"
            android:fadingEdge="none"
            android:layout_marginBottom="1dip"
            android:cacheColorHint="#00000000"
            android:scrollbarAlwaysDrawVerticalTrack="false"
            android:scrollbarStyle="insideOverlay"
            android:paddingBottom="@dimen/input_text_height_adjusted"
            android:transcriptMode="normal"
        />

它的意义就是

stackFromBottom="false":  从上到下依次填充listview

stackFromBottom="true":   从下到上一次填充listvew

 

posted @ 2015-03-18 13:37  小白屋  阅读(1613)  评论(0编辑  收藏  举报