可能重复:
Calling android dialog without it fading the backgorund显示对话框不褪色的背景
有没有办法显示一个对话框(基本上,new Dialog(this).show()
)一点不 “变脸” 的背景活动?
我不希望后面的活动有重点,但我希望它清晰可见,不会消失。
感谢
可能重复:
Calling android dialog without it fading the backgorund显示对话框不褪色的背景
有没有办法显示一个对话框(基本上,new Dialog(this).show()
)一点不 “变脸” 的背景活动?
我不希望后面的活动有重点,但我希望它清晰可见,不会消失。
感谢
尝试使用Dialog (Context context, int theme)构造。 由于theme
参数使用您自己的主题(类似于默认情况下在对话框中使用的com.android.internal.R.style.Theme_Dialog
)。有关主题的更多详细信息,请查看android平台目录中的data/res/themes.xml(Theme.Dialog)。基本上你可以将对话窗口背景改为透明。
这个问题已经回答了这里Calling android dialog without fading the background
基本上你可以做一个样式资源在res/values/styles.xml
这样的:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="myBackgroundStyle" parent="android:Theme">
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
然后用它当你构建新的对话框:
Dialog dialog = new Dialog(this, R.styles.myBackgroundStyle);
您应该将问题标记为重复,而不是发布重复答案。 –
谢谢安娜,我是新来的:) – kyuuCR
见本链接: http://stackoverflow.com/questions/3113812/calling-android-dialog-without-it-f ading-the-backgorund – Thommy