1

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>

enter image description here

3
  • please post your efforts Jan 19, 2018 at 5:16
  • have look this Jan 19, 2018 at 5:20
  • @HemantParmar yeah I have done that too but it only adjusts the margin of sub items Jan 19, 2018 at 5:28

1 Answer 1

0

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.