2016-06-02 9 views
0

Ich habe dies in meinem style.xml DateiFalsche Farben auf Pre-lolipop Geräte mit AppCompatTheme

<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light"> 
    <!-- Customize your theme here. --> 
    <!--<item name="colorPrimary">@color/colorPrimary</item>--> 
    <!--<item name="colorAccent">@color/colorAccent</item>--> 
    <item name="android:windowBackground">@color/white</item> 
    <item name="android:windowTranslucentStatus">true</item> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
</style> 

<style name="LoginScreenTheme" parent="AppTheme"> 
    <item name="android:textColor">@color/white</item> 
    <item name="colorAccent">@color/white</item> 
    <item name="colorPrimaryDark">@color/login_background_dark</item> 
</style> 

<style name="LoginEditTextTheme" parent="AppTheme"> 
    <item name="colorControlNormal">@color/login_edit_text_hint_color</item> 
    <item name="colorControlActivated">@color/login_edit_text_accent</item> 
    <item name="colorControlHighlight">@color/login_edit_text_accent</item> 
    <item name="android:textColorHint">@color/login_edit_text_hint_color</item> 
    <item name="android:textColorPrimary">@color/white</item> 
</style> 

<style name="LoginErrorFloatingLabelTheme" parent="TextAppearance.AppCompat.Small"> 
    <item name="android:textColor">@color/login_error_floating_label_color</item> 
</style> 

<style name="ActionBarTheme" parent="AppTheme"> 
    <item name="android:background">@color/home_primary_color</item> 
</style> 

<style name="LoginWaitingProgressBar" parent="AppTheme"> 
    <item name="colorAccent">@color/orange_light</item> 
</style> 

Bei Geräten mit Lollipop und oberen alles in Ordnung ist, aber auf Pre- Lutscher gibt es falsche Farben. Es sieht so aus, als wäre das Thema nicht auf die Geräte mit Pre-Lollipop Android-Version angewendet. Nach dem googlen fand ich heraus, dass Leute angewiesen werden, "Android:" Präfix vor jedem Element in AppCompat Thema zu entfernen, aber es funktioniert nicht für mich, da android studio keine Elemente danach sieht. Könnte mir bitte jemand helfen?

Vielen Dank im Voraus!

Antwort

0

Der Grund war, dass ich nicht AppCompatActivity verlängern haben. Als ich es änderte, wurde alles in Ordnung.

-1

Die Parameter colorPrimary, colorPrimaryDark und colorAccent sind nur für API 21 + verfügbar. Wenn Sie sie auf Pre-Lollipop-Geräten anwenden möchten, müssen Sie Ihre aktuelle Datei styles.xml in values-v21 verschieben und neue Werte für styles.xml erstellen Ordner und verwenden Sie den richtigen Artikel für Vorlutscher.

Check out Android-Entwickler für mehr https://developer.android.com/guide/topics/ui/themes.html

+0

Es ist völlig falsch. –