Android中ListView显示底部的分割线,需要同事满足以下的选项:
1)mFooterDividersEnabled 必须为true,其默认值是true的
2)ListView的高度必须为FILL_PARENT。
如果不满足上述条件,则分割线是不会显示的。
android:layout_height="fill_parent"
这么设置高度会带来另外一个很不好的体验,滚动很慢。
因为Listview要不断的计算高度。可见的视图要不断的刷新。
list布局如下:
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:dividerHeight="1dip"
android:footerDividersEnabled="true" >
转载,仅供参考。
如果我的回答没帮助到您,请继续追问。
listview 的height设置成match_parent就好了 用wrap_content不会显示 控件就是这么定义的