ConstraintLayout
按照比重分配 并且固定宽高比
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/riv_one"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_5"
android:background="@mipmap/ic_logo_zhong1"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@+id/riv_two"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/riv_two"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_5"
android:background="@mipmap/ic_logo_zhong1"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@+id/riv_three"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/riv_one"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/riv_three"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_5"
android:background="@mipmap/ic_logo_zhong1"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@+id/riv_four"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/riv_two"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/riv_four"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@mipmap/ic_logo_zhong1"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/riv_three"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>