How To Change The Preference Title Color In Android

The Material Design of Android Lollipop has made it easier for developers to customize the theme of their apps. However, making it compatible for pre-Lollipop devices still has its limitations.

I tried to change the preference title color by using textColorPrimary and it did not work. So I had to do it programmatically.

There are two ways to do this. If you have any custom class that extends Preference, then you can add this code in the onBindView() method.

If you are using the existing Preference class or even the CheckBoxPreference, you can do it this way:

That should do the trick!

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *