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

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

        <i id='WB9iq'><tr id='WB9iq'><dt id='WB9iq'><q id='WB9iq'><span id='WB9iq'><b id='WB9iq'><form id='WB9iq'><ins id='WB9iq'></ins><ul id='WB9iq'></ul><sub id='WB9iq'></sub></form><legend id='WB9iq'></legend><bdo id='WB9iq'><pre id='WB9iq'><center id='WB9iq'></center></pre></bdo></b><th id='WB9iq'></th></span></q></dt></tr></i><div id='WB9iq'><tfoot id='WB9iq'></tfoot><dl id='WB9iq'><fieldset id='WB9iq'></fieldset></dl></div>
        <legend id='WB9iq'><style id='WB9iq'><dir id='WB9iq'><q id='WB9iq'></q></dir></style></legend>
          <bdo id='WB9iq'></bdo><ul id='WB9iq'></ul>
      1. Android 对话框宽度

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

                  <legend id='QmSiR'><style id='QmSiR'><dir id='QmSiR'><q id='QmSiR'></q></dir></style></legend>

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

                  问题描述

                  我似乎无法控制对话框宽度.我有一个像这样的简单布局`

                  I can't seem to control the dialog width. I have a simple layout like so`

                  <?xml version="1.0" encoding="utf-8"?>
                  <LinearLayout 
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      android:orientation="vertical"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      android:theme="@android:style/Theme.Dialog"> 
                  
                      <ScrollView 
                          android:orientation="vertical"
                          android:layout_width="fill_parent"
                          android:layout_height="fill_parent">
                          <LinearLayout     android:orientation="vertical"
                          android:layout_width="fill_parent"
                          android:layout_height="fill_parent">
                  
                          <TextView 
                              android:id="@+id/name_prompt_view"
                              android:layout_width="fill_parent"
                              android:layout_height="wrap_content"
                              android:text="@string/name_prompt"
                              android:padding="10dip"/>
                  
                          <EditText 
                              android:id="@+id/name_inp" 
                              android:layout_width="fill_parent" 
                              android:layout_height="wrap_content" 
                              android:lines="1"
                              android:maxLines="1"
                              android:maxLength="48"
                              android:inputType="text" />
                  
                          <TextView 
                              android:id="@+id/t1_prompt_view"
                              android:layout_width="fill_parent"
                              android:layout_height="wrap_content"
                              android:text="@string/t1_prompt"
                              android:padding="10dip"/>
                  
                          <Spinner 
                              android:id="@+id/t1_inp" 
                              android:layout_width="fill_parent" 
                              android:layout_height="wrap_content" 
                              android:lines="1"
                              android:maxLines="1"
                              android:maxLength="48"
                              android:inputType="text"
                              android:singleLine="true"
                              android:layout_weight="1"
                              android:entries= "@array/t1_allowed_values" />
                  
                           </LinearLayout>
                  
                      </ScrollView>
                  
                  </LinearLayout>
                  

                  由于某种原因,对话框的宽度仅足以容纳大约 11 个字符宽的文本输入字段.如何让对话框的宽度填满屏幕?

                  for some reason the dialog is only wide enough for the text input field about 11 chars wide. How do I make the dialog width fill the screen?

                  推荐答案

                  我也遇到了同样的问题.

                  I had the same problem.

                  我使用以下代码制作了对话框 fill_parent 并且效果很好.

                  I used following code to make dialog fill_parent and it worked fine.

                  public class SharePost extends Dialog
                  {
                      @Override
                      public void onCreate(Bundle savedInstanceState)
                      {
                          super.onCreate(savedInstanceState);
                          setContentView(R.layout.adaptor_contentsharepost);
                  
                          LayoutParams params = getWindow().getAttributes();
                          params.height = LayoutParams.FILL_PARENT;
                          getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
                      }
                  }
                  

                  布局

                  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                      android:orientation="vertical"
                      android:id="@+id/dialogWidth"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent">
                  
                      contents here
                  
                  </LinearLayout>
                  

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

                  上一篇:Android 无边框对话框 下一篇:在 AlertDialog 中更改按钮颜色

                  相关文章

                  最新文章

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

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

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

                  <legend id='ugBEO'><style id='ugBEO'><dir id='ugBEO'><q id='ugBEO'></q></dir></style></legend>