开发者

Spinner - different item text in pop-up/list view [duplicate]

This question already has answers here: 开发者_运维技巧 Android Spinner with different layouts for "drop down state" and "closed state"? (6 answers) Closed 8 years ago.

I have a spinner in my Android app, that allows users to select countries. The spinner shows the ISO2 code of the selected country when folded. Here an example:

Spinner - different item text in pop-up/list view [duplicate]

Once the user opens the selection pop-up list, I want to display a more extensive text for each item. So instead of displaying just "AT", the item should read "AT - Austria" as shown in the following screen-shot.

Spinner - different item text in pop-up/list view [duplicate]

Any ideas how I could achieve this?


SpinnerAdapter has a getDropDownView method that can return a different view for the expanded state.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜