1

I want to show drop down in android. I have used spinner for the same but give me layout like enter image description here

However, I want layout like enter image description here

Can anybody tell me how to implement this kind of view. Please help me to solve this issue. Thanks in advance.

Khushi
  • 91
  • 2
  • 11
  • in android spinner works as dropdown.if u want to show as u have shown than u have to create custom dropdown view – AkashG Jul 18 '12 at 05:33
  • 1
    May be it will help you. http://stackoverflow.com/questions/11274174/the-best-way-to-create-drop-down-menu-in-android-2-x-like-in-ics – Ilya Demidov Jul 18 '12 at 05:34
  • FYI, this is happening the same in ICS and JellyBean. – Paresh Mayani Jul 18 '12 at 05:35
  • [may be this post helps you i.e., popup menus][1] [1]: http://stackoverflow.com/questions/11410984/create-a-dropdown-list-in-android-not-spinner – Srinivas Jul 18 '12 at 05:43

2 Answers2

3

The spinner you see in Android is Androids implementation of a drop down box. It is designed to be more friendly to touchscreen devices with little screen real estate. If you want something that behaved like a "normal" drop down box, you would likely have to design it yourself.

On a side note IIRC even drop downs on websites behave that way on an Android device, or severely annoy the user. People coming from outside of Android try to bend Android to act like other devices, but end up alienating the user base. Android system behaves a certain way, and people expect it to be consistent to that style. Regardless of how other systems implement it.

Ashterothi
  • 3,282
  • 1
  • 21
  • 35
0

You can ofcourse implement it yourself, and its not that hard to do.

I have created a dropdown demo project on github to help out with this nn my mind missing view/widget.

Its based on a text view (title) used to display the currently selected alternative, and a linear layout containing the alternative. When the title is clicked i animate in the linear layout with the alternatives, and once a alt is selected the linear layout is animated out.

The project can be found here:

https://github.com/erbsman/DropDownDemo

hope this helps :)

http://youtube.com/watch?v=JX9RmLAoOUY for a video of how it looks, to help you decide if this is what you want :)

Carl-Emil Kjellstrand
  • 1,233
  • 1
  • 10
  • 17