Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
518 views
in Technique[技术] by (71.8m points)

java - Collapsible sub menu in Android Navigation Drawer Menu

I want to make a collapsible sub-menu in my navigation drawer. I started with a Navigation Drawer Activity sample.

My activity_main_drawer.xml:

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

    <item
        android:id="@+id/group2"
        android:title="categoryhere">
        <menu>
            <item
                android:title="title" >
                <menu>
                    <item
                        android:title="item2" />
                    <item
                        android:title="item3" />
                </menu>
            </item>
        </menu>
    </item>
</menu>

This code is not working. I saw that I should use the ExpandableListView but I really don't know how and all posts doesn't explain it.

Please note that this post is not a duplicate of this post, this post or this one. Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...