How Do You Create a Drop-Down Menu?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How Do You Create a Drop-Down Menu?

Postby illiniwatcher » Sat Nov 22, 2008 5:57 am

Hi, folks:

How do you create a drop-down menu? I can't see a "MenuView" or anything like it in the XML Outline editor and I'd like to create a drop-down with a bunch of options.

An example is in the Edit Contact screen where you choose a Ringtone.

Thanks,
Charles
illiniwatcher
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Nov 03, 2008 8:09 am

Top

Postby MrSnowflake » Sun Nov 23, 2008 1:29 pm

what do you mean with drop down menu? A spinner or a PopupMenu?

PopupMenu's kan be created from Activity.onCreateContextMenu or in Views themself.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby illiniwatcher » Sun Nov 23, 2008 9:52 pm

MrSnowflake wrote:what do you mean with drop down menu? A spinner or a PopupMenu?

PopupMenu's kan be created from Activity.onCreateContextMenu or in Views themself.


I don't think I'm talking about either. Go to your Contacts application, then press the Menu button and tap the New Contact button at screen bottom. When the New Contact screen appears, scroll down until you get to "Other Information". Immediately below that heading is "Ringtone" with a control that should read "Default" (or whatever you've most recently chosen). What is that long, rectangular control with the down-arrow button at right? Is that a spinner, a pop-up menu, or something else? I haven't seen it in the documentation.

In Windows this is called a drop-down menu because when you press it, the options drop down underneath it.

Thanks,
Charles
illiniwatcher
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Nov 03, 2008 8:09 am

Postby MrSnowflake » Sun Nov 23, 2008 11:11 pm

That's a spinner: check you api demo's (on the emu, if it isn't on the device), then go to Views -> Spinner. On the emu it's the same menu as the ringtone thingy.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby illiniwatcher » Mon Nov 24, 2008 2:07 am

MrSnowflake wrote:That's a spinner: check you api demo's (on the emu, if it isn't on the device), then go to Views -> Spinner. On the emu it's the same menu as the ringtone thingy.


Thanks! That took care of it. But why in the world is it called a "spinner"?
illiniwatcher
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Nov 03, 2008 8:09 am

Postby MrSnowflake » Mon Nov 24, 2008 10:58 am

That's easy: It's called a spinner because ...

(silence...)

;)
I don't know really.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Postby richard.puckett » Mon Nov 24, 2008 5:55 pm

Back in the m5 days Spinners used to actually look more like what you'd expect a spinner to look like (imagine an animated carousel that only displays one item at a time). Spinners changed to look more like standard dropdown lists since then. The name no longer really matches the behavior.
Image
richard.puckett
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Dec 27, 2007 2:37 am
Location: Seattle, WA

Postby illiniwatcher » Mon Nov 24, 2008 8:59 pm

Thanks, guys, for your help! I'm on my way.
illiniwatcher
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Nov 03, 2008 8:09 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot], Yahoo [Bot] and 8 guests