How to create a NavigationDrawer ExpandableListView in Xamarin.Android

I wanted to make a NavigationDrawer that has an ExpandableListView inside since my menu has a lot of items in it. So I created a sample project and it’s also available on GitHub.

The Drawer Layout was introduced in Android Support Library in Revision 13. To use it install in the Nuget Packages for Xamarin.Android.Support.v4

Next we need a Navigation View to place it inside the Drawer Layout so we will install also Xamarin.Android.Support.Design and Xamarin.Android.Support.v7.AppCompat so that the toolbar will work on earlier Android versions than 5.0 Lolliop.

The files

MainActivity.cs

ExpandableListAdapter.cs

ExpandedMenuModel.cs

Main.axml

list_header.xml

list_submenu.xml

Styles.xml

https://github.com/Florin-Birgu/NavigationDrawer-ExpandableListView-Xamarin.Android

ExpandableListView

Thanks androidcodec and Priyank Patel for the code inspiration.

Leave Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

clear formSubmit