安卓:文字颜色全息光 [英] Android: text color holo light
问题描述
我只是有一个愚蠢的问题... 我使用(或更好,我想用)主题全息光在我的应用程序:我已经在清单文件中设置它。 请看下面的截图:文字太轻了,不是吗?好吧,我知道我可以设置它,但我的问题是:它是在全息主题真正的文本颜色或有一个错误在我的应用程序?我想它,因为它是奇怪的是,在谷歌的illegibile颜色像这样被选中。
I just have a stupid question... I am using (or better, I suppose to use) the theme holo light in my application: I have set it in the manifest file. Look at the screenshot below: the text is too light, isn't it? Ok, I know that I can set it but my question is: is it the real text color in holo theme or there is an error in my application? I suppose it because it's strange that in google an illegibile color like this was chosen.
编辑:
我设置的主题与属性
android:theme="@android:style/Theme.Holo.Light"
应用元素。 这里是whick我填充了listfragment列表视图code:
of the application element. Here is the listview code whick I populated with a listfragment:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/songsLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left"
android:orientation="vertical"
android:padding="12dp" >
<ListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fastScrollEnabled="true"
android:scrollbarStyle="insideInset"
android:textFilterEnabled="false"/>
<TextView
android:id="@+id/songsFragment_titleTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="7dp"
android:paddingBottom="0dp"
android:textSize="18sp"
android:lines="1">
</TextView>
<TextView
android:id="@+id/songsFragment_artistTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="7dp"
android:paddingTop="0dp"
android:lines="1"
android:textSize="14sp">
</TextView>
</LinearLayout>
希望你能帮助我:)
Hope you can help me :)
推荐答案
?我只是碰到了完全相同的问题,但发现如果我产生这样的我的数组适配器:
When you create your Adapter, are you using the application context or the activity? I just ran into the exact same problem but noticed if I generated my Array Adapter like this:
ArrayAdapter<String> listAdapter = new ArrayAdapter<String>(getApplicationContext(),
android.R.layout.simple_list_item_1, tables);
setListAdapter(listAdapter);
然后文本是出现白色。但是,如果我用的活动范围内(所以如果我做了上面的onCreate方法,我可以只使用本)的文字是黑色的。我想,不知我的应用程序是压倒一切的主题。也许这就是/是你的问题呢?
Then the text was appearing white. If, however, I used the activity context (so if I was doing the above in the onCreate method, I could just use "this") the text was black. I think somehow my app was overriding the theme. Perhaps that is / was your issue as well?
这篇关于安卓:文字颜色全息光的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!