• android获得屏幕高度和宽度


    android获取屏幕的高度和宽度用到WindowManager这个类,两种方法:
    1、WindowManager wm = (WindowManager) getContext()
                        .getSystemService(Context.WINDOW_SERVICE);
    
         int width = wm.getDefaultDisplay().getWidth();
         int height = wm.getDefaultDisplay().getHeight();
    
    2、WindowManager wm = this.getWindowManager();
    
         int width = wm.getDefaultDisplay().getWidth();
         int height = wm.getDefaultDisplay().getHeight();
    ---------------------------------------------------------- 不要抱怨,出生不能规划,未来却能规划,大步向前走,永不止步
  • 相关阅读:
    项目总结升级2
    项目总结升级1
    项目总结升级
    项目总结4
    项目总结3
    体温填报app2.0开发
    每日博客
    第一周开课博客
    学习日报
    学习日报
  • 原文地址:https://www.cnblogs.com/caicaixu/p/3737376.html
Copyright © 2020-2023  润新知