Layout_gravity start & end не распространяет элементы на две стороны, но упакован близко - PullRequest
0 голосов
/ 27 февраля 2020

У меня есть такой макет:

<LinearLayout 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="wrap_content"
    android:orientation="horizontal">
  <com.google.android.libraries.onegoogle.account.particle.AccountParticle
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/part_a"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_vertical|start" />
  <ImageView
      android:id="@+id/part_b"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginEnd="14dp"
      android:layout_marginRight="14dp"
      android:layout_gravity="center_vertical|end"
      app:srcCompat="@drawable/my_image" />
</LinearLayout>

Я бы ожидал, что part_a будет выровнен по правому краю, а part_b выровнен по левому краю. (Спасибо android:layout_gravity).

Почему я вижу их упакованными закрытыми друг для друга?

enter image description here

...