Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Android Textcolor being ignored for 5.0 but works for 6.0

Set the Android app theme as Theme.AppCompat.NoActionBar, but when I do

    android:textColor="@color/black"

for a TextView in the xml layout, the color won't change.

However, everything works fine for Android 6.0 devices, but it's not working for Android 5.0 or 4.0.3.

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="23" />

Setting background color works fine. It's just the text color of different views.

compile 'com.android.support:support-v4:+'
compile 'com.android.support:appcompat-v7:+'
like image 453
abounket Avatar asked Mar 13 '23 17:03

abounket


1 Answers

If you are using version v24.0.0 alpha1 or +, turn back to v23.2.1. There is a bug about setting text color on buttons, textviews etc.

Use:

compile 'com.android.support:appcompat-v7:23.2.1'
like image 183
Oğuzhan Döngül Avatar answered Apr 29 '23 21:04

Oğuzhan Döngül