简体   繁体   English

微调框有灰色文字,为什么? 如何将其更改为默认文本颜色?

[英]Spinner has Grey Text, why? How can I change it to default text colour instead?

I implemented this kind of thing in my app but can't figure out why it turns text grey, like in the photo... 我在我的应用中实现了这种功能,但无法弄清楚为什么它变成文本灰色,就像在照片中一样...

anyone know why? 有人知道为什么吗? and I how do i change it to default text colour? 我如何将其更改为默认文本颜色? the spinner in my layout file looks like black text.. but when I run it, it is grey just like in this sample. 我的布局文件中的微调框看起来像黑色文本。.但是,当我运行它时,就像本示例中一样,它是灰色的。

http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html

You'll have to create a custom adapter to hook into the creation of the views. 您必须创建一个自定义适配器,以挂接到视图的创建中。 Similar SO question with some useful info for you: Change spinner font color 类似的问题,为您提供一些有用的信息: 更改微调字体颜色

我不确定我是否真的收到您的问题,但是如果您想更改微调器项目的文本颜色,只需将android:textColor="your color here"到row.xml的TextView中。

yeah I think my question was flawed.. seems like maybe this light grey is default color.. but it looks horrible (unreadable almost) on my galaxy s2.. on emulator it looks ok, but a little light.. 是的,我认为我的问题有缺陷..似乎这种浅灰色是默认颜色..但是在我的银河s2上看起来很可怕(几乎无法读取)。在模拟器上看起来还可以,但是有点浅..

it is first spinner i ever created... 这是我创造的第一台旋转器...

so I solved it by hard-coding a darker grey... but I don't like hard coding because I am unsure if some android devices would skin the background of the spinner to some color that makes a dark grey unreadable? 所以我通过硬编码较深的灰色解决了此问题...但是我不喜欢硬编码,因为我不确定某些android设备是否会将微调框的背景设置为某种颜色,从而使深灰色难以理解?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM