1

As said in the title, I'm trying to create a submenu inside the standard Navigation View menu. But I want it to be expandable and material designed.

<group android:checkableBehavior="single">

    <item
        android:id="@+id/inbox"
        android:checked="false"
        android:icon="@drawable/ic_inbox"
        android:title="@string/inbox_string" />

    <item
        android:title="Submenu title">
        <menu>
            <item
                android:id="@+id/menuSortNewest"
                android:title="Sort by newest" />
            <item
                android:id="@+id/menuSortRating"
                android:title="Sort by rating" />
        </menu>
    </item>


</group>

This way I only obtain an header, without dropdown. Any ideas on how to it?

1
  • NavigationView only supports a single level menu. In order to have expandable submenus, you need to either roll your own nav drawer code or use one of the many Material Design nav drawer components on GitHub. Commented Nov 9, 2015 at 18:46

1 Answer 1

1

As @Kris-larson said in comment, NavigationView only supports a single level menu, to have an expandable submenus you need a custom navigation drawer coded, my suggestion is MaterialDrawer library, a flexible and easy to use drawer library for your project.

Happy coding!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.