2017-01-31 2 views
0

Ich verwende textColor="@color/red" Attribut für die Änderung der Farbe von TextView. Die Farbe des Textes ändert sich zu Rot im Emulator und einige Telefone wie Galaxy s3, ... Aber in der Galaxie S6 ist die Farbe Schwarz.Textfarbe ändert sich nicht in Galaxy s6

Ich versuchte mit AppCompatTextView anstelle von TextView, Farbe in Java-Code ändern Aber Problem löst nicht.

Ich benutze diese Bibliotheken in Gradle-Datei.

compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile 'com.android.support:recyclerview-v7:23.1.1' 
    compile 'com.android.support:cardview-v7:23.1.1' 
    compile 'com.android.support:support-v4:23.1.1' 
    compile 'com.android.support:support-vector-drawable:23.1.1' 
    compile 'com.google.firebase:firebase-messaging:9.6.1' 
    compile 'com.google.firebase:firebase-crash:9.6.1' 
    compile 'com.google.firebase:firebase-core:9.6.1' 
// compile 'com.github.QuadFlask:colorpicker:0.0.12' 
    compile 'com.amitshekhar.android:android-networking:0.1.0' 
    compile 'uk.co.chrisjenx:calligraphy:2.2.0' 

    compile 'com.thebluealliance:spectrum:0.7.1' 

    compile('com.mikepenz:aboutlibraries:[email protected]') { 
     transitive = true 
    } 
    compile 'com.l4digital.fastscroll:fastscroll:1.0.1' 

Warum? Was ist Lösung?

Antwort

0

Verwenden Sie einen Inline-Hex-Farbcode wie # 000000 anstelle einer Referenz.

+0

Ich denke, es wird nicht funktionieren, weil auch diese Methode die Farbe nicht ändert. textview.setTextColor (Color.RED); – user6022289

+0

Bitte versuchen Sie etwas wie diese textview.setTextColor (Color.parseColor ("# FFFFFF")); – eminuluyol

Verwandte Themen