Calling android dialog without it fading the background(调用android对话框而不褪色背景)
问题描述
我有这个漂亮的对话框视图,我将 UserInputDialog 类设置为:
I have this nice dialog view I set my UserInputDialog class to:
我希望我的对话框出现,但背景不会淡出.这可能吗?因为调用此对话框的视图有一个整洁的背景,我希望将其显示为对话框的背景.
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.
我在网上找到了这个:
但不确定如何将其应用于我的对话框?我有一个名为 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.
并将主题应用到您的活动中.
And apply the theme to your activity.
这篇关于调用android对话框而不褪色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!