【问题标题】:how to hide the black lines betwen my ListView rows'如何隐藏我的 ListView 行之间的黑线'
【发布时间】:2018-04-08 17:52:40
【问题描述】:

嘿,我怎样才能在 listView 中隐藏我所在行的地面上的黑线。 或者把线变小也可以。谢谢大家。

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:paddingTop="2dip"
android:paddingBottom="3dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
android:textColor="@android:color/background_dark" />

<ListView
        android:id="@+id/listView2"
        android:layout_width="match_parent"
        android:layout_height="348dp"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="153dp" />

    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_alignParentBottom="true"
        android:layout_marginLeft="20dp" />

【问题讨论】:

标签: android


【解决方案1】:

尝试以下方法:

//Hide the divider
getListView().setDivider(null);

//set the divider height
getListView().setDividerHeight(0);

或者,如果你想用 XML 来做:

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

这里是Developer Notes

还请检查有关此问题的其他线程: How do I remove lines between ListViews on Android?

【讨论】:

  • 很高兴我能帮上忙 :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-16
  • 1970-01-01
  • 2014-10-20
  • 1970-01-01
  • 2010-10-12
相关资源
最近更新 更多