我遇到問題,浮動動作按鈕在協調器佈局中的底部工作表上不重疊。我怎麼解決這個問題?底層佈局是一個地圖片段。浮動動作按鈕不重疊底部工作表
的XML看起來如下:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButtonAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-32dp"
android:layout_gravity="end|top"
android:src="@drawable/ic_add_white_48dp"
app:backgroundTint="@color/colorPrimary"
app:borderWidth="0dp"
app:elevation="4dp"
app:fabSize="normal"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/linear_layout_bottom_sheet">
<!-- include bottom sheet -->
<include layout="@layout/bottom_sheet_peek" />
<!-- include main content -->
<include layout="@layout/bottom_sheet_content" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
也許,你的底紙的高程屬性高於FAB。 –
你嘗試過使用framelayout而不是linearlayout嗎? – Umair
我不認爲它會使用這種佈局。 FAB不應該是底部表格的一部分。 – natario