从Android RelativeLayout删除填充和边距

时间:2020-05-06 09:44:52

标签: java android xml layout formatting

Spaces between generated layouts

我已经尝试了所有方法,但是无法弄清楚如何删除每个块之间的空格。它们是由用户输入生成的集合,因此代码适用于模板

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:textAlignment="center"
    android:gravity="center_horizontal"
    android:weightSum="100"
    android:layout_margin="0dp"
    android:paddingBottom="0dp"
    android:paddingTop="0dp"
    android:layout_marginBottom="-20dp"
    android:divider="@null"
    android:dividerHeight="0dp"
    xmlns:xmls="http://schemas.android.com/apk/res-auto">

1 个答案:

答案 0 :(得分:0)

最好的解决方案是,如果您将recyclerview与适配器一起使用。 tutorial非常好。显然,在相对布局部分中,您需要使用换行内容并匹配父项。

相关问题