2015-09-29 50 views

回答

4

創建color.xml到值文件夾

代碼color.xml

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
     <color name="dark_blue_Shade1">#000080</color> 
</resources> 

如果color.xml已經存在有那麼只要把

<color name="dark_blue_Shade1">#000080</color> 

<resources> </resources>標籤

+0

感謝您的評論:) – Firefog

1

創建color.xml文件中值的文件夾

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <color name="ColorPrimary">#8E67E0</color> 
    <color name="ColorPrimaryDark">#59419B</color> 
    <color name="LightPrimaryColor">@android:color/holo_blue_bright</color> 
    <color name="AccentColor">#ff4081</color> 
    <color name="PrimaryText">#212121</color> 
    <color name="SecondarText">#727272</color> 
</resources> 

,然後在這樣的

<resources> 
    <!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
     <item name="colorPrimary">@color/ColorPrimaryDark</item> 
     <item name="colorPrimaryDark">@color/ColorPrimaryDark</item> 
     <item name="colorAccent">@color/AccentColor</item> 
    </style> 
</resources> 

從這整個項目將採取這種顏色style.xml文件更改。

ColorPrimaryDark

是你的狀態欄的顏色你不想要應用手動系統將得到colorPrimaryDark爲您的狀態欄的顏色

+0

謝謝..的代碼完美運行:) –

相關問題