【发布时间】:2020-02-27 15:02:31
【问题描述】:
我有这个布局:
<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)。
为什么我看到他们挤得很紧?
【问题讨论】:
-
贴一些代码..
-
@MichaelStoddart 我的错,xml 没有被看到
标签: android android-layout android-linearlayout layout-gravity