就是自定义一个主题:
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- Customize your theme here. --> </style> <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> <item name="android:colorPrimary">@color/bar_back_color_main</item> <item name="android:colorPrimaryDark">@color/bar_back_color_main</item> <item name="android:colorAccent">@color/bar_back_color_main</item> </style> </resources>
<resources> <color name="bar_back_color_main">#FFD700</color> </resources>注意colorPrimary 对应ActionBar的颜色
colorPrimaryDark 对应状态栏的颜色 此处就可以设置和app主题一样的颜色
colorAccent 对应EditText编辑时、RadioButton选中、CheckBox等选中时的颜色