【安卓】获得当前activity的宽高即分辨率
DisplayMetrics metrics =new DisplayMetrics();getWindowManager().getDefaultDisplay().getRealMetrics(metrics);int width = metrics.widthPixels;int height = metrics.heightPixels;Log.i("分辨率:","宽:"+width+"高
·
DisplayMetrics metrics =new DisplayMetrics();
getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
int width = metrics.widthPixels;
int height = metrics.heightPixels;
Log.i("分辨率:","宽:"+width+"高:"+height);
更多推荐
已为社区贡献1条内容
所有评论(0)