首页 > 代码库 > android 屏幕划分

android 屏幕划分

技术分享
获取手机屏幕区域高度 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 屏幕划分