<legend id='NdBGS'><style id='NdBGS'><dir id='NdBGS'><q id='NdBGS'></q></dir></style></legend>
<tfoot id='NdBGS'></tfoot>

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

    1. <small id='NdBGS'></small><noframes id='NdBGS'>

      <i id='NdBGS'><tr id='NdBGS'><dt id='NdBGS'><q id='NdBGS'><span id='NdBGS'><b id='NdBGS'><form id='NdBGS'><ins id='NdBGS'></ins><ul id='NdBGS'></ul><sub id='NdBGS'></sub></form><legend id='NdBGS'></legend><bdo id='NdBGS'><pre id='NdBGS'><center id='NdBGS'></center></pre></bdo></b><th id='NdBGS'></th></span></q></dt></tr></i><div id='NdBGS'><tfoot id='NdBGS'></tfoot><dl id='NdBGS'><fieldset id='NdBGS'></fieldset></dl></div>
    2. 调用android对话框而不褪色背景

      时间:2023-08-31
      1. <legend id='37VgJ'><style id='37VgJ'><dir id='37VgJ'><q id='37VgJ'></q></dir></style></legend>
          <tbody id='37VgJ'></tbody>

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

                <small id='37VgJ'></small><noframes id='37VgJ'>

                本文介绍了调用android对话框而不褪色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有这个漂亮的对话框视图,我将 UserInputDialog 类设置为:

                I have this nice dialog view I set my UserInputDialog class to:

                    <LinearLayout android:id="@+id/LinearLayout01" 
                    android:layout_width="fill_parent" 
                    android:layout_height="fill_parent" 
                    android:orientation="vertical"
                    xmlns:android="http://schemas.android.com/apk/res/android">
                
                        <TextView
                        android:id="@+id/nameMessage"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:text="What is your name Captain?"
                        >
                        </TextView>
                        <EditText
                        android:id="@+id/nameEditText"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:textSize="18sp"
                        >
                        </EditText>
                    <LinearLayout android:id="@+id/LinearLayout02" android:layout_width="fill_parent" android:layout_height="wrap_content" 
                        android:layout_gravity="center_horizontal">
                    <Button
                        android:id="@+id/okButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="OK">
                        </Button>
                        <Button android:id="@+id/cancelButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Cancel">
                        </Button>               
                    </LinearLayout>
                </LinearLayout>
                

                我希望我的对话框出现,但背景不会淡出.这可能吗?因为调用此对话框的视图有​​一个整洁的背景,我希望将其显示为对话框的背景.

                I want my dialog to show up but for the background to not fade out. Is this possible? Cause the view that calls this dialog has a neato background I would like to be shown as a backdrop to the dialog.

                我在网上找到了这个:

                <style name="doNotDim" parent="@android:style/Theme.Dialog">
                    <item name="android:backgroundDimAmount">0</item>
                </style >
                

                但不确定如何将其应用于我的对话框?我有一个名为 public class UserInputDialog extends Dialog implements OnClickListener 的类.它将其内容视图设置为上述布局.

                but not sure how to apply that to my dialog? I have a class called public class UserInputDialog extends Dialog implements OnClickListener. It sets its content view to the layout described above.

                我想我做得很好,只是不知道如何添加那种风格,所以我不能淡化背景.

                I think I am doing this all right, just not sure how to add that style so I can NOT fade the background.

                第二个问题:您能否通过使用主题在您的对话框上获得新外观(比如在其中显示带有文本的图像或图标)?

                Secondary question: Can you get new looks on your dialog (by say having an image or icon display with your text there) by using Themes?

                推荐答案

                创建一个 res/values/styles.xml 文件并将其添加到其中.

                Create a res/values/styles.xml file and add this to it.

                <?xml version="1.0" encoding="utf-8"?>
                <resources>
                  <style name="Theme.DoNotDim" parent="android:Theme">
                    <item name="android:backgroundDimEnabled">false</item>
                  </style>
                </resources>
                

                并将主题应用到您的活动中.

                And apply the theme to your activity.

                <activity android:name=".SampleActivity" android:theme="@style/Theme.DoNotDim">
                

                这篇关于调用android对话框而不褪色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在对话框中处理后退按钮? 下一篇:在显示对话框时,我得到“在 onSaveInstanceState 之

                相关文章

                最新文章

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

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

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