• <tfoot id='rEoqR'></tfoot>
    <legend id='rEoqR'><style id='rEoqR'><dir id='rEoqR'><q id='rEoqR'></q></dir></style></legend>
      <i id='rEoqR'><tr id='rEoqR'><dt id='rEoqR'><q id='rEoqR'><span id='rEoqR'><b id='rEoqR'><form id='rEoqR'><ins id='rEoqR'></ins><ul id='rEoqR'></ul><sub id='rEoqR'></sub></form><legend id='rEoqR'></legend><bdo id='rEoqR'><pre id='rEoqR'><center id='rEoqR'></center></pre></bdo></b><th id='rEoqR'></th></span></q></dt></tr></i><div id='rEoqR'><tfoot id='rEoqR'></tfoot><dl id='rEoqR'><fieldset id='rEoqR'></fieldset></dl></div>

      <small id='rEoqR'></small><noframes id='rEoqR'>

        • <bdo id='rEoqR'></bdo><ul id='rEoqR'></ul>

        如何获得对话框大小?

        时间:2023-09-29
        <legend id='SYXoR'><style id='SYXoR'><dir id='SYXoR'><q id='SYXoR'></q></dir></style></legend>

                <tbody id='SYXoR'></tbody>

                <bdo id='SYXoR'></bdo><ul id='SYXoR'></ul>
                <tfoot id='SYXoR'></tfoot>
              • <i id='SYXoR'><tr id='SYXoR'><dt id='SYXoR'><q id='SYXoR'><span id='SYXoR'><b id='SYXoR'><form id='SYXoR'><ins id='SYXoR'></ins><ul id='SYXoR'></ul><sub id='SYXoR'></sub></form><legend id='SYXoR'></legend><bdo id='SYXoR'><pre id='SYXoR'><center id='SYXoR'></center></pre></bdo></b><th id='SYXoR'></th></span></q></dt></tr></i><div id='SYXoR'><tfoot id='SYXoR'></tfoot><dl id='SYXoR'><fieldset id='SYXoR'></fieldset></dl></div>
                • <small id='SYXoR'></small><noframes id='SYXoR'>

                  本文介绍了如何获得对话框大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在寻找一种获取自定义对话框大小的方法.我经历了 this 问题,但是唯一给出的答案是没有用的,因为如果我尝试 mDialog.getWindow().getAttributes().height; 它只返回 -2,这是 WRAP_CONTENT 属性的常量我设置为对话框.我怎样才能得到它的大小.我想知道背景图片的 siye.

                  I am looking for a way to get size of a custom dialog. I went through this question, but the only answer given is pretty useless, because if I try mDialog.getWindow().getAttributes().height; it only returns -2, which is a constant for WRAP_CONTENT attribute which I set to dialog. How can I get the size of it. I want to know the siye for the background image.

                  推荐答案

                  实际上,在 Android 中它不像在 iOS 中那样工作 - 你无法获取 View 本身的大小,什么不过,您可以询问该视图的 ROOT 布局的大小.

                  Actually, in Android it doesn't work like in iOS - you can't get the size of the View itself, what you can do, though, is to ask for the size of the ROOT layout of that view.

                  例如:

                  myDialog.this.findViewById(R.id.dialog_root_layout).getHeight());

                  这篇关于如何获得对话框大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:创建 Java 对话框 下一篇:java中的GUI“转到上一个/下一个"选项?

                  相关文章

                  最新文章

                      <bdo id='IK5MH'></bdo><ul id='IK5MH'></ul>
                    <i id='IK5MH'><tr id='IK5MH'><dt id='IK5MH'><q id='IK5MH'><span id='IK5MH'><b id='IK5MH'><form id='IK5MH'><ins id='IK5MH'></ins><ul id='IK5MH'></ul><sub id='IK5MH'></sub></form><legend id='IK5MH'></legend><bdo id='IK5MH'><pre id='IK5MH'><center id='IK5MH'></center></pre></bdo></b><th id='IK5MH'></th></span></q></dt></tr></i><div id='IK5MH'><tfoot id='IK5MH'></tfoot><dl id='IK5MH'><fieldset id='IK5MH'></fieldset></dl></div>

                    <small id='IK5MH'></small><noframes id='IK5MH'>

                  1. <legend id='IK5MH'><style id='IK5MH'><dir id='IK5MH'><q id='IK5MH'></q></dir></style></legend>

                  2. <tfoot id='IK5MH'></tfoot>