【发布时间】:2020-07-20 14:48:57
【问题描述】:
我在我的 xml 布局中使用此代码我在下面添加了我的布局和一些图像
......
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/notes_container_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
.......
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_note_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium_margin"
android:backgroundTint="@color/colorPrimary"
app:layout_anchor="@id/bottomAppBar"
app:srcCompat="@drawable/ic_add_black_24dp"
tools:ignore="VectorDrawableCompat" />
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:backgroundTint="@color/colorPrimary"
app:hideOnScroll="false"
app:menu="@menu/appbar_menu"
app:navigationIcon="@drawable/ic_menu" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
BottomAppbar 的高度占据了我的整个布局,如图所示
【问题讨论】:
-
它应该是什么样子的?
-
我更新了我的帖子以包含图片
-
发布整个布局
-
我更新了我的问题
标签: android xml android-layout material-components-android android-bottomappbar