Android Styling/Theming of just Search Dialog

后端 未结 2 2057
南方客
南方客 2021-01-20 03:58

tl;dr: White text style in app theme being picked up by search dialog, making search text invisible.

I\'m struggling mightily with what seems like a

2条回答
  •  迷失自我
    2021-01-20 04:29

    The attribute android:textColor is not meant to be used inside theme styles, it is primarily useful in widget and text appearance styles.

    If you want to change the general text colors through a theme, use instead the android:textColor* family of attributes. There are quite a few of them, and different Views use them differently, so it takes a bit of experimentation (or careful studying of the Android source code) to to get it all right. The android.R.attr documentation lists them all. Look for the attributes that begin with textColor....

    To get you started, try this theme, it will behave better by not affecting the Search Dialog colors at all, which seems to be what you want. By the way, you don't need to set android:windowNoTitle to true in your theme as your parent theme does that already:

    
    

提交回复
热议问题