如何在android中为spinner设置标题 [英] how to set a title for spinner in android

查看:1376
本文介绍了如何在android中为spinner设置标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我做了一个Spinner,用于在我的申请中选择性行为。如你所知它有两个项目男性和女性。如果我想在微调器内显示标题,我该怎么办?

i意味着,它必须显示(你的性欲是什么),并且在用户触摸它之后,它有两个显示两个项目...

解决方案

请参阅 http://developer.android.com/guide/topics/ui/controls /spinner.html [ ^ ]。


将标题分配给android:prompt属性并将android:spinnerMode设置为对话框,参考:

http://developer.android.com/reference/android/widget/Spinner.html#attr_android:prompt [ ^ ]

hello!
i made a Spinner for choosing sexuality in my application . as you know it has two items "male" and "female". now what should i do if i want to show a title inside of spinner .
i mean , it has to show ("what is your sexuality") and after user touches it , it has two show two items ...

解决方案

See http://developer.android.com/guide/topics/ui/controls/spinner.html[^].


Assign the title to android:prompt attribute and set the android:spinnerMode to dialog, refer:
http://developer.android.com/reference/android/widget/Spinner.html#attr_android:prompt[^]


这篇关于如何在android中为spinner设置标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆