如何在Android上的ListViews之间删除线? [英] How do I remove lines between ListViews on Android?

查看:61
本文介绍了如何在Android上的ListViews之间删除线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在这样使用两个ListView:

<ListView
   android:id="@+id/ListView"
   android:text="@string/Website"
   android:layout_height="30px"
   android:layout_width="150px"
   android:scrollbars="none"
   android:transcriptMode="normal"/>
<ListView
   android:id="@+id/ListView1"
   android:text="@string/Website"
   android:layout_height="30px"
   android:layout_width="150px"
   android:scrollbars="none"
   android:transcriptMode="normal"/>

两个ListView之间有一个空白行.如何删除它?

There is one blank line between the two ListViews. How do I remove it?

推荐答案

要删除同一ListView中项目之间的分隔符,请使用以下解决方案:

To remove the separator between items in the same ListView, here is the solution:

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

developer.android.com#ListView

或者,如果您想使用XML:

Or, if you want to do it in XML:

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

这篇关于如何在Android上的ListViews之间删除线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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