【发布时间】:2020-09-05 08:52:27
【问题描述】:
【问题讨论】:
-
除了打电话给
fab.hide();试试fab.setVisibility(View.INVISIBLE); -
@MohammedAlaa 如果更改可见性,FAB 下的空白空间仍然存在。
标签: android layout menu floating-action-button
【问题讨论】:
fab.hide(); 试试fab.setVisibility(View.INVISIBLE);
标签: android layout menu floating-action-button
您可以像这样删除菜单属性并添加图标:
<com.google.android.material.bottomappbar.BottomAppBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:fabAlignmentMode="end">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:background="?selectableItemBackgroundBorderless"
app:srcCompat="@drawable/ic_more" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackgroundBorderless"
app:srcCompat="@drawable/ic_search" />
</com.google.android.material.bottomappbar.BottomAppBar>
删除菜单属性后,如果需要,您必须自己创建溢出菜单。
【讨论】: