Multiple Columns on a Spinner?

空扰寡人 提交于 2020-01-06 05:49:28

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/10902366/multiple-columns-on-a-spinner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!