Android 如何在底部应用程序栏的菜单中设置项目的位置?

Android 如何在底部应用程序栏的菜单中设置项目的位置?,android,menu,android-bottomappbar,Android,Menu,Android Bottomappbar,我有一份菜单,我想在里面放几样东西。菜单是底部的应用程序栏。我的问题是,我想更改项目的位置,以便两个项目位于浮动操作栏的左侧,另一个项目位于浮动操作栏的右侧。我该怎么做 我的菜单是: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk

我有一份菜单,我想在里面放几样东西。菜单是底部的应用程序栏。我的问题是,我想更改项目的位置,以便两个项目位于浮动操作栏的左侧,另一个项目位于浮动操作栏的右侧。我该怎么做

我的菜单是:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/delete"
        android:icon="@drawable/ic_delete_black_24dp"
        android:orderInCategory="1"
        android:title="delete"
        app:showAsAction="always" />
    <item
        android:id="@+id/edit"
        android:icon="@drawable/ic_edit_black_24dp"
        android:orderInCategory="2"
        android:title="edit"
        app:showAsAction="always" />
    <item
        android:id="@+id/favorite"
        android:icon="@drawable/ic_favorite_black_24dp"
        android:orderInCategory="3"
        android:title="favorite"
        app:showAsAction="always" />
    <item
        android:id="@+id/info"
        android:icon="@drawable/ic_info_black_24dp"
        android:orderInCategory="4"
        android:title="info"
        app:showAsAction="always" />

</menu>

我的xml是这样的:

<androidx.coordinatorlayout.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">
    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:focusable="true"
        app:layout_anchor="@id/bottomAppBar"
        app:srcCompat="@drawable/ic_add_circle_black_24dp"
        android:backgroundTint="#FF0000"
        tools:ignore="VectorDrawableCompat" />

    <com.google.android.material.bottomappbar.BottomAppBar
        android:id="@+id/bottomAppBar"
        style="@style/Widget.MaterialComponents.BottomAppBar.Colored"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:fabAlignmentMode="center"
        android:backgroundTint="#2196F3"/>


</androidx.coordinatorlayout.widget.CoordinatorLayout>


谢谢你的帮助

你能分享xml布局吗当然可以。