0

I have this layout:

<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>

I would expect part_a to be aligned to the right and part_b aligned to the left. (Thanks to android:layout_gravity).

Why do I see them packed closed to each other?

enter image description here

Elad Benda
  • 35,076
  • 87
  • 265
  • 471

0 Answers0