zoukankan      html  css  js  c++  java
  • android getDecorView()的作用

    decorView是window中的最顶层view,可以从window中通过getDecorView获取到decorView。
    通过decorView获取到程序显示的区域,包括标题栏,但不包括状态栏。间接可以计算状态栏高度。
    比如计算状态栏的高度:

      Rect frame = new Rect();
      getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
      int statusBarHeight = frame.top;
  • 相关阅读:
    Linux Netcat命令
    clang-format
    keytool
    ip
    Linux iptables
    Linux yum源完全配置
    Makefile
    CMake
    HSTS
    开源镜像
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/5166056.html
Copyright © 2011-2022 走看看