【如何获取屏幕尺寸】可以通过以下代码轻松获取屏幕尺寸
//获取屏幕尺寸
DisplayMetrics metric = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metric);
int mScreenWidth = metric.widthPixels;
int mScreenHeight = metric.heightPixels;
【如何获取屏幕尺寸】可以通过以下代码轻松获取屏幕尺寸
//获取屏幕尺寸
DisplayMetrics metric = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metric);
int mScreenWidth = metric.widthPixels;
int mScreenHeight = metric.heightPixels;