Steven Yates
Steven Yates

Reputation: 2480

Android Preference Screen, change color behind title text

I have changed the background color to my preference screen but the title bar is acting strange.

I have this as my theme set in the manifest for the preference activity as below:

<style name="PrefTheme">
    <item name="android:background">@color/activity_default_bg_color</item>
</style>

Which works, but the title bar now looks like this:

Image with no color to background

I have tried playing with a bunch of other properties to change it but can't find the correct one.

Thanks

Steve

Edit:

Looking at the edit text popups they have also changed

Edit text

I tried to change the popups with, but didn't work

<item name="android:windowBackground">@color/activity_default_bg_color</item>
<item name="android:popupBackground">@color/activity_default_bg_color</item>

Upvotes: 2

Views: 1003

Answers (1)

Steven Yates
Steven Yates

Reputation: 2480

This is the problem:

<item name="android:background">@color/activity_default_bg_color</item>

I had to use this instead

 <item name="android:windowBackground">@color/activity_default_bg_color</item>

This fixed both the problems mentioned above.

Hope this helps someone.

Thanks

Steve

Edit:

End Result:

enter image description here enter image description here

Upvotes: 1

Related Questions