如何在两个组菜单项之间添加间隙?

时间:2018-01-08 09:10:32

标签: android

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    tools:showIn="navigation_view">

    <group
        android:id="@+id/profile"
        android:checkableBehavior="single">

        <item
            android:id="@+id/nav_profile"
            android:icon="@drawable/ic_my_profile"
            android:title="@string/nav_item_my_profile"
            app:actionLayout="@layout/view_alertsbadge" />
    </group>
    <group
        android:id="@+id/contacts"
        android:checkableBehavior="single">

        <item
            android:id="@+id/nav_merge"
            android:icon="@drawable/ic_merge"
            android:title="@string/nav_item_merge" />
        <item
            android:id="@+id/nav_export"
            android:icon="@drawable/ic_export"
            android:title="@string/nav_item_export" />
        <item
            android:id="@+id/nav_notifications"
            android:actionLayout="@layout/layout_switch"
            android:icon="@drawable/ic_notifications"
            android:title="@string/nav_item_notifications" />
    </group>
    <group
        android:id="@+id/shareapp"
        android:checkableBehavior="single">

        <item
            android:id="@+id/nav_share"
            android:icon="@drawable/ic_share"
            android:title="@string/nav_item_share" />
        <item
            android:id="@+id/nav_rate"
            android:icon="@drawable/ic_my_profile"
            android:title="@string/nav_item_rate" />
    </group>
    <group android:id="@+id/blank1">


    </group>
    <group
        android:id="@+id/aboutapps"
        android:checkableBehavior="single">

        <item
            android:id="@+id/nav_report"
            android:icon="@drawable/ic_report"
            android:title="@string/nav_item_report" />
        <item
            android:id="@+id/nav_faq"
            android:icon="@drawable/ic_faq"
            android:title="@string/nav_item_faq" />

        <item
            android:id="@+id/nav_about"
            android:icon="@drawable/ic_about"
            android:title="@string/nav_item_about" />

    </group>
    <group android:id="@+id/blank">


    </group>
    <group
        android:id="@+id/logout"
        android:checkableBehavior="single">

        <item
            android:id="@+id/nav_logout"
            android:icon="@drawable/ic_logout"
            android:title="@string/nav_item_logout" />
    </group>


</menu>

这是我的navigationmenu.xml使用这个我的屏幕就像这样

enter image description here

我的预期屏幕如下:

enter image description here

我必须在每个组项目之间添加间隙或在每个组之间添加一些填充而不是每个项目,即我们必须在分隔符上添加间隙,请参阅我当前的屏幕和预期的屏幕。我尝试了很多,但我无法向你建议我。

0 个答案:

没有答案