android沉浸式状态栏
来源:互联网 发布:java ftp下载文件夹 编辑:程序博客网 时间:2024/06/10 16:14
SystemBarTint链接:https://github.com/messnoTrace/SystemBarTintManager
使用方法比较简单,官方给了一个例子:
public class MatchActionBarActivity extends Activity { @Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_match_actionbar);if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {setTranslucentStatus(true);}SystemBarTintManager tintManager = new SystemBarTintManager(this);tintManager.setStatusBarTintEnabled(true);tintManager.setStatusBarTintResource(R.color.statusbar_bg);//通知栏所需颜色}@TargetApi(19) private void setTranslucentStatus(boolean on) {Window win = getWindow();WindowManager.LayoutParams winParams = win.getAttributes();final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;if (on) {winParams.flags |= bits;} else {winParams.flags &= ~bits;}win.setAttributes(winParams);}}
android:fitsSystemWindows="true"
设置颜色
<color name="colorPrimary">#01bcf9</color><color name="colorPrimaryDark">#01bcf9</color><color name="colorAccent">#ffffff</color>
colorPrimary actionbar的颜色
colorPrimaryDark 状态栏的颜色
colorAccent 页面的主体颜色
android:fitsSystemWindows="true"
0 0
- Android 沉浸式状态栏
- android 沉浸式 状态栏
- android 沉浸式状态栏
- android沉浸式状态栏
- Android沉浸式状态栏
- Android 沉浸式状态栏
- android 沉浸式状态栏
- Android沉浸式状态栏
- Android沉浸式状态栏
- Android 沉浸式状态栏
- Android沉浸式状态栏
- android 沉浸式状态栏
- android 沉浸式状态栏
- Android沉浸式状态栏
- android沉浸式状态栏
- Android 沉浸式状态栏
- android沉浸式状态栏
- Android沉浸式状态栏
- (Caffe)基本类Filter(五)
- 简单简单
- AlertDialog动态setItems数据
- 读《解忧杂货店》东野圭吾(日本人)
- 破解不同的Excel密码的方法
- android沉浸式状态栏
- PAT B 1015. 德才论 (25)
- Spark 的 Shell操作,核心概念,构建独立应用
- 冒泡排序
- Nginx自启动脚本(ubuntu 安装版)
- Android AsyncTask完全解析,带你从源码的角度彻底理解
- dash mpd之$Number$
- Qualcomm Symphony System Manager SDK使用举例
- 懒人工具4 -- 模拟键盘鼠标 自动化操作 xdotool