简体   繁体   中英

Adjust the margin of group title in navigation drawer

How can I decrease the margin of the menu headings as shown in the image. I am using the menu to inflate the items in the drawer. Just want to decrease the top and bottom margin from the menu headings. Here is nav_drawer_items.xml

<item
    android:title="MAIN"
    android:id="@+id/tabs"
    android:checkableBehavior="single">
    <menu>
    <item
        android:id="@+id/nav_home"
        android:title="@string/nav_home"
        android:icon="@drawable/home_icon"/>
    <item
        android:id="@+id/nav_movies"
        android:title="@string/nav_movies"
        android:icon="@drawable/genre_icon"/>
    <item
        android:id="@+id/nav_originals"
        android:title="@string/nav_originals"
        android:icon="@drawable/genre_icon"/>

    <item
        android:id="@+id/nav_live_tv"
        android:title="@string/nav_live_tv"
        android:icon="@drawable/genre_icon"/>
    </menu>

</item>

<item android:id="@+id/others"
    android:title="SUPPORT">
    <menu>
        <item
            android:id="@+id/nav_about_us"
            android:title="@string/nav_about_us"
            android:icon="@drawable/genre_icon"/>
        <item
            android:id="@+id/nav_feedback"
            android:title="@string/nav_feedback"
            android:icon="@drawable/genre_icon"/>
        <item
            android:id="@+id/nav_setting"
            android:title="@string/nav_setting"
            android:icon="@drawable/genre_icon"/>
    </menu>
</item>

在此处输入图片说明

You can change the group title padding by adding the following line to your dimens.xml file

<dimen tools:override="true" 
name="design_navigation_separator_vertical_padding">0dp</dimen>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM