Как сохранить чистоту интерьера полупрозрачного вида при создании тени с помощью высоты? - PullRequest
0 голосов
/ 09 июля 2020

После этого сообщения: https://developer.android.com/training/material/shadows-clipping#Elevation,

У меня есть представление:

<View
    android:id="@+id/view"
    android:layout_width="202dp"
    android:layout_height="188dp"
    android:background="@drawable/bg_layout_1"
    android:alpha="0.6"
    android:elevation="45dp"
    android:outlineProvider="bounds"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

это выглядит так:

enter image description here

Although the view's and its parent layout's background color are #FFFFFF, the android:alpha="0.6" makes the view looks "dirty". I hope the shadow is only drawn outside the border of the view, not the interior zone, is that possible?

What I'd like to achieve is like this (view's transparency is necessary meanwhile):

введите описание изображения здесь

...