簡體   English   中英

使底部工作表在頂部 android studio 有陰影

[英]Make bottom sheet have a shadow at the top android studio

我有一張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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM