0

標高が機能しないため、この SO 回答を使用して BottomSheetDialogFragment の標高をシミュレートしています。

https://stackoverflow.com/a/40927770/11110509

ただし、その偽の影を追加すると、そのSOの回答とは異なり、不要な空白があります。どうすれば削除できますか?

ここに画像の説明を入力

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:elevation="6dp">

    <View
        android:id="@+id/fragplaces_top_shadow"
        android:layout_width="match_parent"
        android:layout_height="16dp"
        android:background="@drawable/shadow_dialog_places_top"/>

    <TextView
        android:id="@+id/fragplaces_app_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Places near me"
        android:textColor="@color/colorWhite"
        android:textStyle="bold"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/fragplaces_top_shadow"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:background="@color/standardBlue"/>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/fragadd_recycler"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/fragplaces_app_name"
        android:background="@color/colorWhite"/>

</RelativeLayout>

偽の影は次のとおりです。

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:angle="90"
        android:endColor="@android:color/transparent"
        android:startColor="#64000000"/>
</shape>

親レイアウトに透明な背景を追加しても機能しません。

android:background="@android:color/transparent"

偽の影の不要な空白を削除するにはどうすればよいですか?

4

2 に答える 2