如何添加这么多分频器?

How to add so many divider?

大家好,我有一个只有相对布局的应用程序,我有很多中等大小的文本,比如我有十个中等大小的文本。

我想在每个文本下面添加一个divider/separator。

这个我试过了

<View
android:layout_width = "match_parent"
android:layout_height = "1dp"
android:background="?android:attr/listDivider"/>

但是我每次都手动安排它们非常困难。我必须在很多不同的 activity

上执行此操作

所以请告诉我最简单的方法,提前谢谢。

使用 RelativeLayout 并包含 android:layout_below 使其在文本下方对齐。

 <TextView
        android:id="@+id/textidhere"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
 <View
        android:id="@+id/divider"
        android:layout_width="match_parent"
        android:layout_height="1dip"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:background="#dcddde"
        android:layout_below="@id/textidhere"/>