开发者

Getting screen width without using SurfaceHolder

开发者 https://www.devze.com 2023-03-31 19:50 出处:网络
How do I get the phone\'s width or height without using S开发者_如何学CurfaceHolder?Using DisplayMetrics displaymetrics = new DisplayMetrics();

How do I get the phone's width or height without using S开发者_如何学CurfaceHolder?


Using

DisplayMetrics displaymetrics = new DisplayMetrics();  
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
ht = displaymetrics.heightPixels;
wt = displaymetrics.widthPixels;
0

精彩评论

暂无评论...
验证码 换一张
取 消