开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜