2016-03-05 86 views
0

我是業餘的android開發和我一直在eclipse上的項目。我已經完成了我的android:minSdkVersion =「21」和android:targetSdkVersion =「22」,並在API上的項目構建目標在21以下是我的style.xml中的錯誤錯誤:沒有發現資源匹配給定的名稱:attr'colorAccent'在Eclipse中

[2016-03-05 15: 55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:12:錯誤:錯誤:找不到與給定名稱匹配的資源:attr'colorAccent'。

[2016-03-05 15:55:13 - IOT] [2016-03-05 15:55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:10:error :錯誤:找不到與給定名稱匹配的資源:attr'colorPrimary'。

[2016-03-05 15:55:13 - IOT] [2016-03-05 15:55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:11:error :錯誤:找不到與給定名稱匹配的資源:attr'colorPrimaryDark'。

[2016-03-05 15:55:13 - IOT] [2016-03-05 15:55:13 - IOT] C:\ workspace \ Iot \ res \ values \ style1.xml:8:error :錯誤:找不到與給定名稱匹配的資源:attr'windowNoTitle'。

這裏是style.xml

<resources> 

    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base"> 

    </style> 

    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <item name="windowNoTitle">true</item> 
     <item name="windowActionBar">false</item> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
    </style> 

</resources> 

的XML代碼,我用做什麼,我會很高興,如果有人可以幫助我這個問題有點混亂。提前致謝。

回答

0

使用這些屬性爲:

<resources> 
    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base">  
    </style> 

    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <item name="android:windowNoTitle">true</item> 
     <item name="android:windowActionBar">false</item> 
     <item name="android:colorPrimary">@color/colorPrimary</item> 
     <item name="android:colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="android:colorAccent">@color/colorAccent</item> 
    </style> 

</resources> 
+0

感謝您的幫助!我很抱歉用這麼小的邏輯來打擾。 –

相關問題