如何给排列表视图之间的空白? [英] How to give empty space between rows of listview?

查看:131
本文介绍了如何给排列表视图之间的空白?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我的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>

这篇关于如何给排列表视图之间的空白?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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