开发者

Are there any methods for android development that can find the maximum units on screen?

开发者 https://www.devze.com 2023-03-25 22:51 出处:网络
I\'m drawing a rectangle and I\'m trying to figure out the maximum dimensions of the display I\'m using with开发者_如何学Goout trial and error. I know the top left corner is (0,0), but is there a meth

I'm drawing a rectangle and I'm trying to figure out the maximum dimensions of the display I'm using with开发者_如何学Goout trial and error. I know the top left corner is (0,0), but is there a method that retrieves the outer edge coordinates?


In your activity you can call:

Display display = getWindowManager().getDefaultDisplay(); 
display.getWidth(); // returns width
display.getHeight(); // returns height

This will give you the maximum dimensions of the current display.

0

精彩评论

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