首页 > 移动平台 > 详细

android 屏幕划分

时间:2017-02-26 15:35:19      阅读:217      评论:0      收藏:0      [点我收藏+]
技术分享
获取手机屏幕区域高度 public int getWindowArea() { Display display = getWindowManager().getDefaultDisplay(); Point point = new Point(); display.getSize(point); int width = point.x; int height = point.y; return height; }
应用区域高度
    public int getApplicationArea() {
        Rect rect = new Rect();     
        getWindow().getDecorView().                                               
        getWindowVisibleDisplayFrame(rect);
        int width = rect.width();
        int height = rect.height();
        return height;
    }
 获取view绘制区域高度
    public int getDrawArea() {
        Rect rect = new Rect(); 
        getWindow().findViewById(Window.ID_ANDROID_CONTENT)     
                   .getDrawingRect(rect);
        int width = rect.width();
        int height = rect.height();
        return height;
    }

android 屏幕划分

原文:http://www.cnblogs.com/x-bing/p/6444522.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!