<tfoot id='2ZPu0'></tfoot>

  • <small id='2ZPu0'></small><noframes id='2ZPu0'>

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

        android对话框活动位置

        时间:2023-08-30

          • <bdo id='3rvmE'></bdo><ul id='3rvmE'></ul>
          • <tfoot id='3rvmE'></tfoot>
          • <legend id='3rvmE'><style id='3rvmE'><dir id='3rvmE'><q id='3rvmE'></q></dir></style></legend>
                <tbody id='3rvmE'></tbody>

              <small id='3rvmE'></small><noframes id='3rvmE'>

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

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

                  问题描述

                  我使用 android:theme="@android:style/Theme.Dialog" 创建了一个非最大化活动,使其看起来像一个对话框.我需要更改活动在屏幕上的位置,但我没有找到如何执行此操作...

                  I created an non-maximized activity using android:theme="@android:style/Theme.Dialog" to make it looks like a dialog. I need to change the position of the activity on screen but I didn't find how to do this...

                  推荐答案

                  要改变位置(主题设置为Theme.Dialog),可以覆盖重力、大小和坐标活动装饰视图附加到窗口后的 LayoutParams.这是一个例子:

                  To change the position (with the theme set to Theme.Dialog), you can override the gravity, size and coordinates of the LayoutParams of your activity's decor view after it has been attached to the window. Here's an example:

                  @Override
                  public void onAttachedToWindow() {
                      super.onAttachedToWindow();
                  
                      View view = getWindow().getDecorView();
                      WindowManager.LayoutParams lp = (WindowManager.LayoutParams) view.getLayoutParams();
                      lp.gravity = Gravity.LEFT | Gravity.TOP;
                      lp.x = 10;
                      lp.y = 10;
                      lp.width = 300;
                      lp.height = 300;
                      getWindowManager().updateViewLayout(view, lp);
                  }
                  

                  这篇关于android对话框活动位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 ImageView 显示 AlertDialog 而无需任何填充 下一篇:BottomSheetDialogFragment - 听用户事件解除

                  相关文章

                  最新文章

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

                    <bdo id='CJwr1'></bdo><ul id='CJwr1'></ul>

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