I want to show drop down in android. I have used spinner for the same but give me layout like
However, I want layout like
Can anybody tell me how to implement this kind of view. Please help me to solve this issue. Thanks in advance.
I want to show drop down in android. I have used spinner for the same but give me layout like
However, I want layout like
Can anybody tell me how to implement this kind of view. Please help me to solve this issue. Thanks in advance.
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.
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 :)