【发布时间】:2021-09-02 23:44:11
【问题描述】:
我的项目中有一个 ListView 。如何根据下图自定义设计(每行和下一行之间必须存在间隙或空格,并且每行的颜色必须因 ListView 的背景而异)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/hadis_lsv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</ListView>
</RelativeLayout>
【问题讨论】:
-
可以向我们展示您的尝试吗?
-
您应该更改 row_layout 中每一行的颜色,对于“gap”或“space”,您只需在 row_layout 中指定一个边距。
标签: android xml user-interface