5

I wanna make a dropdown-menu like the one in the attached picture in android I searched a lot but I Couldn't find anything?

Could you tell me how to start?

dropdown-menu

1
  • 1
    Please consider adding a screenshot to your post explaining what you think a "dropdown-menu" is in Android. For example, you might post a screenshot of a "dropdown-menu" that you have seen in another application. You can use DDMS (standalone or the Eclipse plugin) to take the screenshot. Commented Jun 11, 2011 at 22:58

3 Answers 3

6

If you are trying to do something where you see a list of items as you type in text into a TextView, you may be looking for an AutoCompleteTextView. An implementation example can be found here.

If you are trying for the more usual drop down menu, you may want to use a Spinner widget. An example of its implementation can be found here.

Let me know if you need any more help.

Sign up to request clarification or add additional context in comments.

Comments

0

Android does not generally use a "dropdown-menu" like the one you have in your screenshot. I encourage you to learn the Android UI framework and stick to it.

In Honeycomb (the tablet UI), there is the "nav mode" of the action bar that will look a bit similar, though it is not designed to be a menu.

7 Comments

Actually I meant the menu I showed up there not a spinner.But I appreciate your help guys. @CommonsWare Do you suggest that I use spinner or do you know something else closer to my objective?
@FAFI: As I indicated in my answer, your objective is wrong. Android applications do not use "dropdown-menus". I am not aware of any current mobile OS that does. Please follow standard UI conventions for the platform. Since I have absolutely no idea what the business problem is that you are trying to solve, I cannot tell you if a Spinner or an options menu or something else is the right answer.
Actually it's more than just the list nav mode of the action bar, Spinner widgets as of Honeycomb use the in-place dropdown style by default. android.widget.PopupMenu also offers a simple API for presenting these style menus anchored to arbitrary views.
@adamp: Your solutions are for Honeycomb. The community has no idea how it will play out on Ice Cream Sandwich (ICS) as Google tries to put part of Honeycomb into a phone-sized screen -- for all we know, on phones nav mode in the action bar won't be supported and PopupMenu will be frowned upon. Combine that with the need to support the 99.4% of Android devices in use today that run pre-Honeycomb versions of Android, and I am not comfortable advising people to employ a "dropdown-menu" UI at this time. If UX folk at Google have recommendations for us in this area, I'd love to hear them!
@adamp: I was in the room for that presentation. I do not recall Reto covering the topic under debate in this question. It's a good presentation, though.
|
0

Your best bet is going to be to make a view with the menu you want. Then make an animation that will grow the X and Y scale over some amount of time.

Ex:

android:fromXScale="0.1"
android:toXScale="1.0"
android:fromYScale="0.1"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="0%"
android:duration="@android:integer/config_shortAnimTime"

Then all you have to do is apply the application to your view in the appropriate onclicklistener

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.