0

I've been trying for ages and ages to get a custom spinner to work and basically nothing will work.

I've been after something like this:

http://www.f1-manager.co.uk/Misc/CustomSpinner.png

Basically I want to display 3 items from a database, the first name, last name and some other bits of information on the Other Info bit and then of course a picture of said person.

Is this even possible? I was told that using a custom spinner can achieve this but I can't find a good enough example to help me.

Any help would be great. :-)

Thanks, Chris

Chris Mayhew
  • 25
  • 1
  • 8

1 Answers1

0

Use a TableLayout to design the UI for the items in the spinner. Then in your adapter, just fill out the layout content as you would any other layout.

Here is layout design of what I mean:

TableLayout
    TableRow
        TextView -> FirstNameHeader
        TextView -> LastNameHeader
    TableRow
        TextView -> FirstNameData
        TextView -> LastNameData
    TableRow
        TextView -> OtherData
ahodder
  • 11,353
  • 14
  • 71
  • 114
  • Thanks mate, I've figured out how to get it displaying now using your advice. – Chris Mayhew Jun 05 '12 at 19:05
  • I've made a layout for my rows and got it displaying information out of the database but now they aren't selectable? Any ideas? – Chris Mayhew Jun 06 '12 at 09:22
  • @ChrisMayhew What specifically isn't selectable? The layout I have shown you is designed to be a list item. It's content is not suppose to be directly modifyable. You will need a moderator to change it (activity or something like it). – ahodder Jun 06 '12 at 14:51
  • Well basically i've applied a similar layout to my spinner but I can't select any items in the spinner? So say for example I have John Smith in the spinner and I try to select him nothing happens? It doesn't even look like it's pressed it? – Chris Mayhew Jun 06 '12 at 19:27