解决了
基本上,而不是试图迫使菜单的资源,我需要的布局,我用这个方法,而不是,我只是把使用“空”元素作为@dglozano建议BottomAppBar内的LinearLayout。
使用?attr/selectableItemBackgroundBorderless我也能做到这一点实在是类似于BottomNavigationView的效果。
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center"
app:layout_anchorGravity="start"
app:hideOnScroll="true"
app:fabAnimationMode="scale"
app:fabAlignmentMode="center"
app:backgroundTint="@color/colorPrimary">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="5"
android:paddingEnd="16dp">
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@drawable/ic_home_white_24dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:tint="@color/secondary_text"/>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@drawable/ic_map_black_24dp"
android:background="?attr/selectableItemBackgroundBorderless"/>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent"/>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@drawable/ic_people_white_24dp"
android:background="?attr/selectableItemBackgroundBorderless"/>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@drawable/ic_account_circle_24dp"
android:background="?attr/selectableItemBackgroundBorderless"/>