<small id='48Fn6'></small><noframes id='48Fn6'>

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

  • <legend id='48Fn6'><style id='48Fn6'><dir id='48Fn6'><q id='48Fn6'></q></dir></style></legend>

      <bdo id='48Fn6'></bdo><ul id='48Fn6'></ul>

        <tfoot id='48Fn6'></tfoot>
      1. Android 对话框:删除标题栏

        时间:2023-08-31
            <bdo id='71k8U'></bdo><ul id='71k8U'></ul>
            • <i id='71k8U'><tr id='71k8U'><dt id='71k8U'><q id='71k8U'><span id='71k8U'><b id='71k8U'><form id='71k8U'><ins id='71k8U'></ins><ul id='71k8U'></ul><sub id='71k8U'></sub></form><legend id='71k8U'></legend><bdo id='71k8U'><pre id='71k8U'><center id='71k8U'></center></pre></bdo></b><th id='71k8U'></th></span></q></dt></tr></i><div id='71k8U'><tfoot id='71k8U'></tfoot><dl id='71k8U'><fieldset id='71k8U'></fieldset></dl></div>
              <tfoot id='71k8U'></tfoot>

                <legend id='71k8U'><style id='71k8U'><dir id='71k8U'><q id='71k8U'></q></dir></style></legend>

              1. <small id='71k8U'></small><noframes id='71k8U'>

                    <tbody id='71k8U'></tbody>

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

                  问题描述

                  我有一个奇怪的行为,我无法确定其来源.

                  I have a weird behavior I can't pinpoint the source of.

                  我有我的经典应用

                  requestWindowFeature(Window.FEATURE_NO_TITLE);
                  

                  删除标题/状态栏.

                  然后我创建一个对话框以允许用户输入信息(姓名等)

                  I then create a Dialog box to allow the user to enter information (name etc)

                  使用物理键盘没问题,但是当我使用虚拟键盘时,我有一个奇怪的行为:

                  With a physical keyboard, no problem but when I use the virtual keyboard I have a strange behavior:

                  每次我在虚拟键盘上按下一个键时,标题/状态栏都会重新出现,推动所有键盘布局然后再次消失(就像我启动应用程序时的动画一样)

                  each time I hit a key on the virtual key board the title/status bar reappears pushing all the keyboard layout around then vanishes again (just like the animation of when I start the application)

                  这里有一些代码:

                          dialog = new Dialog(context);
                          dialog.setContentView(R.layout.logindialog);
                          dialog.setTitle("Login:");
                  
                          WindowManager.LayoutParams a = dialog.getWindow().getAttributes();
                  
                  //      dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                  
                          a.dimAmount = 0;
                          dialog.getWindow().setAttributes(a);
                  
                          dialog.setCancelable(true);
                          dialog.getWindow().setLayout(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
                  

                  然后

                  dialog.show();
                  

                  我试过了

                  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                  

                  但它使我的应用程序崩溃.

                  but it crashes my app.

                  这里是xml

                      <TextView android:id="@+id/LoginText"
                          android:gravity="fill"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Login:">
                      </TextView>         
                      <EditText android:id="@+id/LoginEdit"
                          android:layout_height="wrap_content"
                          android:singleLine="true"
                          android:text="jason"
                          android:layout_width="200sp"/>
                      <TextView android:id="@+id/PasswordText"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Password:">
                      </TextView>         
                      <EditText android:id="@+id/PasswordEdit"
                          android:layout_height="wrap_content"
                          android:singleLine="true"
                          android:text="welcome"
                          android:layout_width="200sp"
                          android:password="true"/>
                  <LinearLayout 
                      android:id="@+id/test2"
                      android:gravity="center_horizontal"
                      android:orientation="horizontal"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content">
                  <Button android:id="@+id/LoginButton"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerHorizontal="true"
                      android:text="Login" />
                  <Button android:id="@+id/CreateButton"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerHorizontal="true"
                      android:text="Create" />
                  <Button android:id="@+id/CancelLogin"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerHorizontal="true"
                      android:text="Cancel" />
                  </LinearLayout>/>
                  

                  推荐答案

                  使用,

                  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); //before     
                  dialog.setContentView(R.layout.logindialog);
                  

                  这篇关于Android 对话框:删除标题栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Android Dialog,按下按钮时保持对话框打开 下一篇:如何将 Android Spinner 创建为弹出窗口?

                  相关文章

                  最新文章

                  1. <i id='8Yvjb'><tr id='8Yvjb'><dt id='8Yvjb'><q id='8Yvjb'><span id='8Yvjb'><b id='8Yvjb'><form id='8Yvjb'><ins id='8Yvjb'></ins><ul id='8Yvjb'></ul><sub id='8Yvjb'></sub></form><legend id='8Yvjb'></legend><bdo id='8Yvjb'><pre id='8Yvjb'><center id='8Yvjb'></center></pre></bdo></b><th id='8Yvjb'></th></span></q></dt></tr></i><div id='8Yvjb'><tfoot id='8Yvjb'></tfoot><dl id='8Yvjb'><fieldset id='8Yvjb'></fieldset></dl></div>
                  2. <small id='8Yvjb'></small><noframes id='8Yvjb'>

                  3. <legend id='8Yvjb'><style id='8Yvjb'><dir id='8Yvjb'><q id='8Yvjb'></q></dir></style></legend>

                      • <bdo id='8Yvjb'></bdo><ul id='8Yvjb'></ul>
                      <tfoot id='8Yvjb'></tfoot>