为什么Android限制基线不垂直工作

为什么Android限制基线不垂直工作,android,android-layout,Android,Android Layout,我试图通过“app:layout\u constraintBaseline\u toBaselineOf”对齐这三个小部件,但是,如下面的结果所示,它似乎没有正确对齐: 如何将它们对齐并发送到屏幕底部?图像视图没有基线,因此请删除所有基线约束。删除播放按钮上的app:layout\u constraintTop\u toTopOf=“parent”约束。这会将播放按钮发送到屏幕底部。(约束到顶部和底部,使小部件居中。) 一旦“播放”按钮位于底部,就可以调整其他视图。有关详细信息,请参阅文档。谢

我试图通过“app:layout\u constraintBaseline\u toBaselineOf”对齐这三个小部件,但是,如下面的结果所示,它似乎没有正确对齐:

如何将它们对齐并发送到屏幕底部?

图像视图没有基线,因此请删除所有基线约束。删除播放按钮上的
app:layout\u constraintTop\u toTopOf=“parent”
约束。这会将播放按钮发送到屏幕底部。(约束到顶部和底部,使小部件居中。)


一旦“播放”按钮位于底部,就可以调整其他视图。有关详细信息,请参阅文档。

谢谢!删除所有基线但保留app:layout_constraintTop_toTopOf=“parent”后,两个视图将在中心对齐。使用app:layout_constraintVertical_bias可以帮助我控制它们挂在正确的位置。
<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/playButton"
        android:layout_width="73dp"
        android:layout_height="62dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@android:drawable/ic_media_play" />

        <ImageView
            android:id="@+id/nextMusic"
            android:layout_width="73dp"
            android:layout_height="62dp"
            android:layout_marginEnd="66dp"
            app:layout_constraintStart_toEndOf="@+id/playButton"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@+id/playButton"
            app:layout_constraintBottom_toBottomOf="@+id/playButton"
            app:layout_constraintBaseline_toBaselineOf="@+id/playButton"
            app:srcCompat="@android:drawable/ic_media_next" />

        <ImageView
            android:id="@+id/previousMusic"
            android:layout_width="73dp"
            android:layout_height="62dp"
            android:layout_marginStart="84dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/playButton"
            app:layout_constraintBottom_toBottomOf="@+id/playButton"
            app:layout_constraintBaseline_toBaselineOf="@+id/playButton"
            app:srcCompat="@android:drawable/ic_media_previous" />
    </androidx.constraintlayout.widget.ConstraintLayout>