Прежде всего, здесь ширина изображения очень мала.Таким образом, вы можете использовать FrameLayout
, затем добавить android:layout_gravity="start"
для первого просмотра изображения и android:layout_gravity="end"
для второго.И вам не нужно добавлять ограничения для детей, отличных от ConstraintLayout
.Смотри приведенную ниже схему.
<FrameLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_gravity="start"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:srcCompat="@drawable/ic_arrow_back_black_24dp"/>
<ImageView
android:id="@+id/imageView3"
android:layout_width="30dp"
android:layout_gravity="end"
android:layout_height="30dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:srcCompat="@drawable/shopicon"/>
</FrameLayout>