版本4.4
1.在style.xml中添加
<item name="android:windowTranslucentStatus" tools:targetApi="kitkat">true</item>
2.改变状态栏颜色
在要适配的activity (比如activity_main.xml) 里修改根layout(最底层的标签)的背景色。将跟layout颜色设置成colorPrimaryDark(状态栏的颜色)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity"
android:background="@color/colorPrimaryDark" >