很好用的Android 沉浸样式 很方便

来源:互联网 发布:js c标签的if else 编辑:程序博客网 时间:2024/06/06 05:41

https://github.com/zyj1609wz/Android-StatusBarColor


http://www.jcodecraeer.com/a/opensource/2016/0328/4095.html

亲测 效果挺好的 


使用方法

1、 android studio 添加依赖库

 compile 'com.jaeger.statusbaruitl:library:1.0.0'

2、 代码中使用

//设置颜色StatusBarUtil.setColor(MainActivity.this, Color.rgb(255,99,17),1);
 
//设置颜色 StatusBarUtil.setColor(Activity1.this, Color.BLUE ); //设置透明度,0- 255 StatusBarUtil.setTranslucent( Activity2.this , 127 ) ; //设置全屏 StatusBarUtil.setTransparent(  Activity3.this ) ; //侧边菜单 mDrawerLayout = (DrawerLayout) findViewById( R.id.drawer_layout ); mDrawerLayout.setDrawerShadow(R.mipmap.ic_launcher , GravityCompat.START); StatusBarUtil.setColorForDrawerLayout( Activity4.this  , mDrawerLayout , Color.BLUE) ;

0 0
原创粉丝点击