2016-06-08 2 views
0

Das Thema, das ich für mein Fragment erstellt funktioniert nicht. Ich erhalte eine rote Fehlermeldung mit der Meldung "Validiert Ressourcenreferenzen innerhalb der Android-XML-Datei". Ich habe das richtige Thema auch im Manifest zugewiesen. Die Stile-Datei ist hier:Android: Theme nicht angewendet und Stil Elternteil zeigt in rot

<resources> 
<style name="AppTheme" parent="@android:Theme.Holo.Light"> 
    <item name="android:actionBarStyle">@style/MyActionBarTheme</item> 
</style> 

<style name="MyActionBarTheme" parent="@android:Theme.Holo.Light.ActionBar"> 
    <item name="android:background">#3FF4CB</item> 
</style> 
</resources> 

Mein Manifest ist hier:

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <activity 
     android:name=".LaunchActivity" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".PhysicsFragment" 
     android:label="@string/title_activity_physics_fragment" > 
    </activity> 
    <activity 
     android:name=".EconFragment" 
     android:label="@string/title_activity_econ_fragment" > 
    </activity> 
    <activity 
     android:name=".ChemFragment" 
     android:label="@string/title_activity_chem_fragment" > 
    </activity> 
</application> 

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

</manifest> 

Antwort

0

Wenn Sie Gonna Android Ressourcen verwenden, sollten Sie Namespace so etwas wie folgt verwenden:

<style name="MyActionBarTheme" parent="@android:style/Theme.Holo.Light.ActionBar"> 
Verwandte Themen