删除的ListView分隔符(在XML布局文件)布局、文件、分隔符、ListView

2023-09-04 08:25:21 作者:等待和相遇

如何删除的行分隔符的的ListView (如果可能的XML布局文件中,其中它的描述)?

How can I remove the rows separator in a ListView(if possible within the XML layout file where it's described)?

推荐答案

设置dividerHeight零和除法器为null像这样的XML:

Set the dividerHeight to zero and divider to null like this in xml:

android:dividerHeight="0dp"
android:divider="@null"

或者在java中:

getListView().setDividerHeight(0);
getListView().setDivider(null);