我有一个bottom sheet
,我希望顶部有shadow
,因为背面碎片是白色的,底部薄片也是白色的,这会混淆
下面是底部页面的代码
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:behavior_hideable="true"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<RelativeLayout
android:id="@+id/bottomsheet"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Bottom Sheet Text"
android:textSize="30sp"/>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
添加
android:elevation="15dp"
android:outlineProvider="bounds"
到您的bottomsheet
视图组(RelativeLayout(