移除 ListView 分隔符(在 xml 布局文件中) [英] Remove ListView separator(in the xml layout file)

查看:10
本文介绍了移除 ListView 分隔符(在 xml 布局文件中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

在xml中像这样将dividerHeight设置为零,divider设置为null:

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);

这篇关于移除 ListView 分隔符(在 xml 布局文件中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆