简体   繁体   中英

How to put ExpandableListView inside spinner in android

I am looking for Spinner having ExpandablelistView inside it. I want to click on the spinner view , it shows the ExpandablelistView main categories inside it, then by clicking any of the main category, the sub categories will be shown. i found this example spinner within expandable list view? in the child menu i want the same ExpandablelistView but inside spinner view. i am new to android and are in the stage of learning. Any help will be heartly appreciated. Thanks

Spinner and ExpandableListview are two independent views so you can not embedded one into the other. But I have some solution for you here:

  1. Add a spinner to main layout
  2. Add a ExpandableListView to main layout
  3. Then On Click/Touch event of spinner you have to show the listview on spinner's bottom.

Note: Data which you want to show in spinner then you have to show it in listview.

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