如何给排列表视图之间的空白?视图、空白、列表

由网友(失我者永失)分享简介:在我的应用我的ListView与行list.So的,我可以给背景的每一行,它看起来像行段之间空空间的要求。In my application I have a requirement of listview with empty spaces between rows of list.So that I can gi...

在我的应用我的ListView与行list.So的,我可以给背景的每一行,它看起来像行段之间空空间的要求。

In my application I have a requirement of listview with empty spaces between rows of list.So that I can give background to each row and it will look something like blocks of rows.

我尽力了,但没有找到任何解决方案。

I tried my best but didnt find any solution.

推荐答案

您可以使用安卓分安卓dividerHeight 来行之间自定义间隔。

You can use android:divider and android:dividerHeight to customize the spacing between rows.

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">

  <ListView 
    android:id="@+id/android:list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:divider="#FF0000"
    android:dividerHeight="4px"/>

</LinearLayout>
阅读全文

相关推荐

最新文章