zoukankan      html  css  js  c++  java
  • 沉浸式

     1 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
     2             int flagTranslucentStatus = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
     3             int flagTranslucentNavigation = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
     4             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
     5                 Window window = getWindow();
     6                 WindowManager.LayoutParams attributes = window.getAttributes();
     7                 attributes.flags |= flagTranslucentNavigation;
     8                 window.setAttributes(attributes);
     9                 getWindow().setStatusBarColor(Color.TRANSPARENT);
    10             } else {
    11                 Window window = getWindow();
    12                 WindowManager.LayoutParams attributes = window.getAttributes();
    13                 attributes.flags |= flagTranslucentStatus | flagTranslucentNavigation;
    14                 window.setAttributes(attributes);
    15             }
    16         }
  • 相关阅读:
    Angular2使用boostrap和ng-bootstrap总结
    Java
    Java
    Java 13
    Java 12
    Java 11
    Java 9
    Java 8- Java 分支结构
    Java 7-Java 循环结构
    Java 6- Java 运算符
  • 原文地址:https://www.cnblogs.com/SongYongQian/p/8778795.html
Copyright © 2011-2022 走看看