zoukankan      html  css  js  c++  java
  • Android--获取标题栏,状态栏,屏幕高度

    获取状态栏高度

    Rect frame = new Rect();  
    getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);  
    int statusBarHeight = frame.top; 

    获取actionBar的高宽度

    有一个属性:

    android:layout_width="?attr/actionBarSize"
    android:layout_height="?attr/actionBarSize"

    获取屏幕高度,宽度

    DisplayMetrics dm = new DisplayMetrics();  
      
    this.getWindowManager().getDefaultDisplay().getMetrics(dm);//this指当前activity  
      
    screenWidth =dm.widthPixels;  
      
    screenHeight =dm.heightPixels;
  • 相关阅读:
    yii分页
    ajax分页
    批删,全选
    网站开发的愿景
    margin collapse 坍塌
    URI URL URN
    Servlet
    Http请求
    进程间通信
    网络编程
  • 原文地址:https://www.cnblogs.com/819158327fan/p/4946892.html
Copyright © 2011-2022 走看看