Elevation 不适用于 ConstraintLayout 中的 include 标签

问题描述 投票:0回答:0

Elevation 在 ConstraintLayout 中不起作用,按钮始终显示在全屏进度的前面...... 这是一个示例代码,原始代码要大得多所以请不要建议使用 FrameLayout。 ^^ 谢谢

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.appcompat.widget.AppCompatButton
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="0dp"
        android:text="Update"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.89" />

    <include
        android:id="@+id/full_screen_progress"
        layout="@layout/layout_progressbar_fullscreen"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:elevation="20dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

我也试过在ConstraintLayout中移动不同位置的元素但是没有结果

android layout data-binding android-constraintlayout elevation
© www.soinside.com 2019 - 2024. All rights reserved.