当我创建一个仅具有ListView的简单布局时,在最后一项之后没有显示分隔符,这看起来有点难看。
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
但是,我发现如果在列表视图下添加另一个视图并为列表视图设置2724439142703703825920属性,则会在最后一项之后显示分隔符。
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom"
android:layout_alignParentTop="true" />
android:id="@+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/holo_blue_dark"
android:text="Bottom" />
为什么列表视图的行为是这样的? 如何在仅包含列表视图的布局中的最后一项之后添加分隔符?