开发者

Real size of Android dialog

开发者 https://www.devze.com 2023-03-16 19:58 出处:网络
How can I know the real size of some custom dialog box with specified \"fill_parent\" measures? Explanation:

How can I know the real size of some custom dialog box with specified "fill_parent" measures?

Explanation:

I have an XML wi开发者_Python百科th a custom dialog box. The W/H sizes are "fill_parent". Android shows some cute dialog box much lesser than X/Y of screen. I'd like to know the exact size of this dialog after it was shown.

Thanks.


Each view has two pairs of Size values.

One pair is getMeasuredWidth() and getMeasuredHeight(), this value describes how big specific widget wants to be.

Second pair is getWidth() and getHeight(), called drawable Width and drawable Height, this values describe Size of the widget after drawing.

Keep in mind padding as well.

Hope this helps, let me know if you need more assistance.

0

精彩评论

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