cuốn sách gpt4 ai đã làm

Độ cao không hoạt động với BottomSheet trong bố cục điều phối viên

In lại Tác giả: Taklimakan Thời gian cập nhật: 2023-11-02 07:48:24 25 4
mua khóa gpt4 Nike

我正在尝试在布局中使用 BottomSheet。 Root View 是一个 Điều phối viênBố trí,我想在 Bottom Sheet 的顶部设置 Elevation,所以我将它设置为高值 (50dp),但它没有显示当应用程序运行但它出现在 android studio 设计工具上时。

我尝试用纯色而不是渐变色为工作表设置背景,但它仍然有效。我也尝试使用阴影形状,但它没有提供相同的高度外观。

这是我的 XML



xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.atefhares.StartActivity"
android:clipToPadding="false">


android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">


android:id="@+id/DetailsView"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical">


android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Details Should be shown here"
android:id="@+id/textView"
android:textSize="25sp"
android:padding="20dp" />


<đoạn xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.atefhares.Start_Activity" />



<>
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:behavior_peekHeight="70dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
android:background="@drawable/gradiant"
android:fillViewport="true"
android:elevation="50dp">







编辑:bottom_sheet_layout.xml


android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical">



android:orientation="ngang"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/colorPrimary"
android:padding="10dp"
android:id="@+id/inviteLL">


android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/imageView"
android:background="@drawable/invite_icon"
android:layout_margin="5dp"
android:layout_gravity="center_vertical" />


android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Invite Friends"
android:textSize="22sp"
android:textColor="#ffffff"
android:padding="10dp"
android:fontFamily="sans-serif-condensed"
android:trọng lực="center_vertical"
android:id="@+id/inviteTV"

android:layout_rabity="center_vertical"
android:layout_weight="1" />


android:layout_width="30dp"
android:layout_height="30dp"
android:id="@+id/arrowIV"
android:layout_rabity="center_vertical"
android:background="@drawable/arrow_up" />




android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/usersLV"
android:dividerHeight="1dp"
android:divider="#ffffff"
android:background="#ffffff" />


Vì thếlàm sao tôi có thể vào đượcTấm dưới cùng

Độ cao hiển thị ở trên cùng?

Có ai có thể giúp được không?

câu trả lời hay nhất

hãy thử cái này,

<>
android:id="@+id/bottom_sheet"
xmlns:slide_panel="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:behavior_peekHeight="70dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
android:background="@drawable/gradiant"
android:fillViewport="true"
slide_panel:elevation="50dp">

Về android - độ cao không hoạt động với BottomSheet trong bố cục điều phối viên, chúng tôi đã tìm thấy một câu hỏi tương tự trên Stack Overflow: https://stackoverflow.com/questions/38670125/

25 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress