开发者

Height of screen in portrait mode only?

开发者 https://www.devze.com 2022-12-25 08:37 出处:网络
How can I get the height of the device for portrait mode? I have to create a bitmap (which is zoomable) and I just want to get a rough idea what the tallest height should be.

How can I get the height of the device for portrait mode? I have to create a bitmap (which is zoomable) and I just want to get a rough idea what the tallest height should be.

getResources().getDisplayMetrics().heightPixels;

do开发者_开发问答es the above return the height, in portrait mode only?

I'm not binding my UI to this absolute value, it's just a rough fit,

Thanks


Display d = getWindowManager().getDefaultDisplay(); 
int potraitHeight = Math.max(d.getWidth(),d.getHeight());
0

精彩评论

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

关注公众号