1

私はアプリケーションにスタイルファイルを持っており、ステータスバーの色としてcolorPrimaryDarkを取得していません。私はNexus 6で点検していますが、it.isには何かが欠けています。ColorPrimaryDarkステータスバーの色として表示されない

enter image description here

style.xml

<resources> 

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


    </style> 


</resources> 

style.xml(V21)

<resources> 

    <!-- Base application theme. --> 
    <!--Application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <item name="android:windowDrawsSystemBarBackgrounds">false</item> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
     <!--All customizations that are NOT specific to a particular API-level can go here. --> 
    </style> 


</resources> 

Menifest - ないテーマ任意の活動で定義

<application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 

COが存在しませんLORファイル

<color name="colorPrimary">#35734F</color> 
    <color name="colorPrimaryDark">#35734F</color> 
    <color name="colorAccent">#D2AB67</color> 
+0

ポスト色のXMLマニフェストファイル – FAT

+0

コードが更新されるようになりました。.. – 9spl

答えて

0

変更親に "Theme.AppCompat.Light.NoActionBar" あなたstyle.xml(v21)<item name="android:windowDrawsSystemBarBackgrounds">true</item><item name="android:statusBarColor">@android:color/transparent</item>を追加

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

</style> 

</resources> 
1

してみてください。

style.xml

<resources> 

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

    <style name="AppTheme" parent="AppBaseTheme"> 

</resources> 

style.xml(V21)

<resources> 

    <!-- Base application theme. --> 
    <!--Application theme. --> 
    <style name="AppTheme" parent="AppBaseTheme"> 
     <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
     <item name="android:statusBarColor">@android:color/transparent</item> 
    </style> 

</resources> 
+0

これを@FerdousAhamedは実際に私を解きます問題! –

+0

アクティビティのステータスバーの一部が白くなっている場合は、このリンクをご覧ください。https://stackoverflow.com/a/38182815/3121246 –

関連する問題