我有一个 ListView ,我需要在其中显示联系人图片及其详细信息。 格式:
垂直分隔符根本没有出现! 这是我的 listitem 布局文件: [这里使用相对布局,因为我有更多 View 要添加到列表中相对]
<ImageButton android:id="@+id/pic"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"/>
<ImageView android:id="@+id/vertical_separator"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@android:drawable/divider_vertical_bright"
android:layout_toRightOf="@id/badge"
android:layout_alignWithParentIfMissing="true"/>
<TextView android:id="@+id/details"
android:layout_toRightOf="@id/verticalseparator"
android:layout_alignTop="@id/badge"
android:layout_alignWithParentIfMissing="true"/>
即使高度为 "fill_parent",分隔符在联系人图片后显示为一个小点。我尝试将宽度更改为 2dp ..但还是一样。
--我使用一个ListAdapter来填充这个类型的列表:
我在这里遗漏了什么吗?水平分隔线显示正确,但垂直分隔线显示不正确
最佳答案
我认为 ImageView 和 TextView 中的“@id/badge”应该改为“@id/pic”。 (或者反过来。)
关于android - android listview 中的垂直分隔线不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4324889/