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

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

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

    <tfoot id='W7jsk'></tfoot>

      1. Android - 使用 Xml 布局自定义对话框

        Android - Customizing Dialog using an Xml Layout(Android - 使用 Xml 布局自定义对话框)
        <tfoot id='MwLaW'></tfoot>

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

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

          <tbody id='MwLaW'></tbody>

        <legend id='MwLaW'><style id='MwLaW'><dir id='MwLaW'><q id='MwLaW'></q></dir></style></legend>
                • <bdo id='MwLaW'></bdo><ul id='MwLaW'></ul>
                  本文介绍了Android - 使用 Xml 布局自定义对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在下面创建此布局,但我似乎得到了正确的我需要的布局.我想要完成的是有一个自定义对话框,使用布局.我尝试编辑下面的 xml,但如果这显示为对话框定义的布局是一团糟.请帮助我了解我需要做什么这.感谢并期待.他们的对话框正在显示,但不符合布局.

                  I am trtying to create this layout below, but I can seem to get the right layout that I need. What I'm trying to accomplish is have a customize dailog box, using a layout. I tried edit the xml below but if this is shown as a dialog the defined layout is a mess. Please help me understand what I need to do for this. THanks and looking forward. They dialog is SHOWING but the layout is not met.

                  这个布局是我想要完成的:

                  This layout is what I am trying to accomplish:

                  对话框:

                  View checkBoxView = View.inflate(this, R.layout.display_item_dialog, null);
                  CheckBox checkBox = (CheckBox)checkBoxView.findViewById(R.id.checkBox1);
                  checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
                  
                       public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                         // Save to shared preferences
                       }   
                  });
                  checkBox.setText("Search All Images");
                  AlertDialog.Builder builder = new AlertDialog.Builder(this);
                  builder.setTitle("Image Preferences");
                  builder.setMessage(" Select from below ")
                  .setView(checkBoxView)
                  .setCancelable(false)
                  .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int id) {
                      }
                  })
                  .setNegativeButton("No", new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int id) {
                          dialog.cancel();
                      }
                  }).show();
                  

                  display_item_dialog.xml

                  display_item_dialog.xml

                  <?xml version="1.0" encoding="utf-8"?>
                  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent" >
                  
                      <TextView
                          android:id="@+id/textView1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_alignParentLeft="true"
                          android:text="Map Category: BEVERAGES" />
                  
                      <ImageView
                          android:id="@+id/imageView1"
                          android:layout_width="200dip"
                          android:layout_height="200dip"
                          android:layout_alignParentLeft="true"
                          android:layout_below="@+id/textView1"
                          android:layout_marginTop="14dp"
                          android:src="@drawable/sunny" />
                  
                      <TextView
                          android:id="@+id/textView2"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_alignParentLeft="true"
                          android:layout_centerVertical="true"
                          android:text="TextView" />
                  
                      <TextView
                          android:id="@+id/textView3"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_alignParentLeft="true"
                          android:layout_below="@+id/textView2"
                          android:layout_marginTop="28dp"
                          android:text="TextView" />
                  
                      <Button
                          android:id="@+id/button1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_alignParentRight="true"
                          android:layout_alignTop="@+id/imageView1"
                          android:layout_marginRight="20dp"
                          android:layout_marginTop="47dp"
                          android:text="+" />
                  
                      <Button
                          android:id="@+id/button2"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_above="@+id/textView2"
                          android:layout_alignLeft="@+id/button1"
                          android:layout_marginBottom="14dp"
                          android:text="-" />
                  
                      <EditText
                          android:id="@+id/editText1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_alignLeft="@+id/button2"
                          android:layout_alignRight="@+id/button2"
                          android:layout_below="@+id/button1"
                          android:ems="10"
                          android:clickable="false" >
                  
                          <requestFocus />
                      </EditText>
                  
                      <CheckBox
                          android:id="@+id/checkBox1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_alignParentLeft="true"
                          android:layout_below="@+id/textView3"
                          android:layout_marginTop="33dp"
                          android:text="CheckBox" />
                  
                  </RelativeLayout>
                  

                  推荐答案

                  试试这个:

                  <?xml version="1.0" encoding="utf-8"?>
                  <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent" >
                  
                  <LinearLayout
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:orientation="vertical" >
                  
                      <TextView
                          android:id="@+id/textView1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Map Category: BEVERAGES" />
                  
                      <LinearLayout
                          android:id="@+id/linear"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="14dp"
                          android:gravity="center_vertical" >
                  
                          <ImageView
                              android:id="@+id/imageView1"
                              android:layout_width="0dp"
                              android:layout_height="200dip"
                              android:layout_weight="0.6"
                              android:src="@drawable/ic_launcher" />
                  
                          <LinearLayout
                              android:layout_width="0dp"
                              android:layout_height="wrap_content"
                              android:layout_weight="0.4"
                              android:orientation="vertical" >
                  
                              <TextView
                                  android:id="@+id/TextView01"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="TextView" />
                  
                              <Button
                                  android:id="@+id/button1"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:layout_gravity="center_horizontal"
                                  android:text="+" />
                  
                              <EditText
                                  android:id="@+id/editText1"
                                  android:layout_width="match_parent"
                                  android:layout_height="wrap_content"
                                  android:layout_gravity="center_horizontal"
                                  android:clickable="false" >
                  
                                  <requestFocus />
                              </EditText>
                  
                              <Button
                                  android:id="@+id/button2"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:layout_gravity="center_horizontal"
                                  android:text="-" />
                          </LinearLayout>
                      </LinearLayout>
                  
                      <TextView
                          android:id="@+id/textView2"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="TextView" />
                  
                      <TextView
                          android:id="@+id/textView3"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="TextView" />
                  
                      <CheckBox
                          android:id="@+id/checkBox1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="CheckBox" />
                  </LinearLayout>
                  
                  </ScrollView>
                  

                  这篇关于Android - 使用 Xml 布局自定义对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)

                  • <bdo id='4F1rA'></bdo><ul id='4F1rA'></ul>

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

                      <small id='4F1rA'></small><noframes id='4F1rA'>

                      <legend id='4F1rA'><style id='4F1rA'><dir id='4F1rA'><q id='4F1rA'></q></dir></style></legend>

                          • <tfoot id='4F1rA'></tfoot>