获取手机宽度

WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
int width = wm.getDefaultDisplay().getWidth();
int height = wm.getDefaultDisplay().getHeight(); 

猜你喜欢

转载自blog.csdn.net/yongwoozzang/article/details/83305994