获取手机屏幕的分辨率

xiaoxiao2021-02-28  141

获取手机屏幕宽和高的方法:

WindowManager wm = (WindowManager)getSystemService(WINDOW_SERVICE); int screenWidth = wm.getDefaultDisplay().getWidth(); int screenHeight = wm.getDefaultDisplay().getHeight(); Log.i("wk","屏幕的宽度:"+screenWidth+"屏幕的高度:"+screenHeight);
转载请注明原文地址: https://www.6miu.com/read-31517.html

最新回复(0)