2016-09-05 6 views
3

Ich bin wie unten ein Thema in styles.xml mit:Androide Action-Bar Text Custom Color

<style name="AppTheme" parent="Theme.AppCompat.Light"> 
    <item name="colorPrimary">@color/md_blue_700</item> 
    <item name="android:colorAccent">@color/md_blue_900</item> 
    <item name="android:colorPrimaryDark">@color/md_blue_900</item> 
    <item name="android:windowBackground">@color/md_white_1000</item> 
    <item name="android:colorControlNormal">@color/md_blue_700</item> 
    <item name="android:colorControlActivated">@color/md_blue_700</item> 
    <item name="android:colorControlHighlight">@color/md_blue_700</item> 
    <item name="android:textColorPrimary">@color/md_white_1000</item> 
</style> 

, die ich als android bin erklärt: Thema in AndroidManifest.xml:

<activity 
     android:name=".LoginActivity" 
     android:theme="@style/AppTheme" 
     android:label="@string/activity_login_actionbar" /> 

Die Problem ist im Bild unten rot hervorgehoben.

Da ich

<item name="android:textColorPrimary">@color/md_white_1000</item> 

auf weißen Text in der Statusleiste Einstellung bin erscheint auch weiß und ist unsichtbar. Wenn ich es in Grau ändere, ändert sich auch der Text in der Aktionsleiste in Grau, was ich nicht möchte.

Ich habe Dinge ausprobiert, wie ein separates Thema für den Fortschritt Dialog zu schaffen, aber wenn ich tue, dass ich die abgerundeten Ecken des Dialoges und so verlieren.

Das ist mein Java-Code für die Erstellung der Spinner:

progressDialog = new ProgressDialog(this); 
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 
progressDialog.setTitle("Attempting Sign In"); 
progressDialog.setMessage("Please wait..."); 
progressDialog.setCancelable(false); 

Wie soll ich über die Lösung dieses Problems gehen?

Alle Antworten geschätzt!

enter image description here

+0

was eine lustige und ausgewogene Frage –

Antwort

2

Sie Theme.AppCompat.Light.DarkActionBar und <item name="android:textColorPrimary">@color/md_white_1000</item> in Ihrem Thema Stil entfernen, dann der Titel wird weiß verwenden können. Sie können den Vergleich zwischen Light and Dark themes here

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <item name="colorPrimary">@color/md_blue_700</item> 
    <item name="android:colorAccent">@color/md_blue_900</item> 
    <item name="android:colorPrimaryDark">@color/md_blue_900</item> 
    <item name="android:windowBackground">@color/md_white_1000</item> 
    <item name="android:colorControlNormal">@color/md_blue_700</item> 
    <item name="android:colorControlActivated">@color/md_blue_700</item> 
    <item name="android:colorControlHighlight">@color/md_blue_700</item> 
</style>