• <small id='P1El4'></small><noframes id='P1El4'>

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

      1. 如何获得对话框大小?

        How to get dialog size?(如何获得对话框大小?)

            <small id='8zXK6'></small><noframes id='8zXK6'>

            <i id='8zXK6'><tr id='8zXK6'><dt id='8zXK6'><q id='8zXK6'><span id='8zXK6'><b id='8zXK6'><form id='8zXK6'><ins id='8zXK6'></ins><ul id='8zXK6'></ul><sub id='8zXK6'></sub></form><legend id='8zXK6'></legend><bdo id='8zXK6'><pre id='8zXK6'><center id='8zXK6'></center></pre></bdo></b><th id='8zXK6'></th></span></q></dt></tr></i><div id='8zXK6'><tfoot id='8zXK6'></tfoot><dl id='8zXK6'><fieldset id='8zXK6'></fieldset></dl></div>
            <tfoot id='8zXK6'></tfoot>
              • <bdo id='8zXK6'></bdo><ul id='8zXK6'></ul>
                  <tbody id='8zXK6'></tbody>
                1. <legend id='8zXK6'><style id='8zXK6'><dir id='8zXK6'><q id='8zXK6'></q></dir></style></legend>
                  本文介绍了如何获得对话框大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找一种获取自定义对话框大小的方法.我经历了 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());

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

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

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

                        • <bdo id='rF70N'></bdo><ul id='rF70N'></ul>
                              <tbody id='rF70N'></tbody>

                          1. <tfoot id='rF70N'></tfoot>