getMetrics
getDisplay
getScreen
getWindows
获取屏幕密度 getScreen
获取设备屏幕大小 getDisplay
获得屏幕的属性,从而取得屏幕的高度和宽度 getMetrics
获得window对象 getWindows
WindowManager manager = this.getWindowManager(); DisplayMetrics outMetrics = new DisplayMetrics(); manager.getDefaultDisplay().getMetrics(outMetrics); int width = outMetrics.widthPixels; int height = outMetrics.heightPixels;
获取屏幕密度 getScreen 获取设备屏幕大小 getDisplay 获得屏幕的属性,从而取得屏幕的高度和宽度 getMetrics 获得window对象 getWindows
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题