1.在项目中加入compile 'com.jaeger.statusbaruitl:library:1.2.7'
调用 StatusBarUtil.setColorNoTranslucent(curActivity,getResources().getColor(R.color.colorPrimaryDark));
2
一. 导入
//compile 'com.android.support:appcompat-v7:25.3.1'//这个不行
compile 'com.android.support:appcompat-v7:23+'//这个可以
二.然后调用AppThemes即可
<style name="AppThemes" 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="android:windowNoTitle">true</item>
</style>
http://www.cnblogs.com/dubo-/我的博客地址
<item name="android:windowFullscreen">true</item>
<item name="android:windowTranslucentStatus">true</item>