1. 程式人生 > >設置狀態欄以及全局的顏色

設置狀態欄以及全局的顏色

owb wid andro blog ren mar window img images

技術分享

一.在Application中設置樣式:

android:theme="@style/AppTheme"

<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/colorPrimaryDark</item>
<!-- 設置全局背景色-->
<item name="android:windowBackground">@color/colorAccent</item>
</style>

設置狀態欄以及全局的顏色