In Android, the color of the status bar is the same as that of our App. androidapp
In fact, there is nothing. It is a topic. Let's look at the code below:
<Resources> <! -- Base application theme. --> <style name = "AppTheme" parent = "AppBaseTheme"> <! -- Customize your theme here. --> </style> <! -- Style of the status bar --> <! --> <Style name = "AppBaseTheme" parent = "Theme. appCompat. light "> <item name =" colorPrimary "> @ color/bar_back_color_main </item> <item name =" colorPrimaryDark "> @ color/bar_back_color_main </item> <item name =" col1_cent "> @ color/bar_back_color_main </item> </style> </resources>
Three important attributes:
- ColorPrimary ------------ color of the corresponding ActionBar.
- ColorPrimaryDark ------- color of the corresponding status bar
- Col1_cent ------------ corresponds to the colors selected during EditText editing, RadioButton selection, and CheckBox selection.