开发者

Changing android search dialog text color

I styled my App using a theme as described here.

<style name="MyThemeNameHere" parent="@android:style/Theme.NoTitleBar">
    <item name="android:windowBackground">@drawable/background</item>
    <item name="android:textColor">#eee</item>
<style>

It works like a charm in most of the App. The background is pretty dark while the text color is bright and text looks good and is easy to read.

Now in the search dialog that android creates for me the background is white, but the text color picks up my style and gets v开发者_C百科ery bright and thus extremely hard to read. I tried also setting android:background to a dark color - This fixed the problem in the search dialog, but caused all textview, etc to get a dark background rather than transparent.

I want to either set the the color or the background only on the search dialog. How do I do this?


As pointed out by Mark Philip the solution can be found in this question: Android Styling/Theming of just Search Dialog

Basically it should be styled like so

<style name="master" paret="@android:style/Theme.NoTitleBar">
    <item name="android:textColorPrimary">#EEEEEE</item>
    <item name="android:textColorSecondary">#EEEEEE</item>
    <item name="android:textColorTertiary">#EEEEEE</item>
</style>

The root cause was that I styled the android:textColor which should never be styled.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜