I have a Dialog that I display in my application, but I want to be able to change the semi-transparent black background to be 100% transparent. Like below, the part that grays out the activity behind the dialog, I'd like that to be transparent so that I can see the underlying activity as it, instead of being darkened. Thanks for your help!
Asked
Active
Viewed 638 times
0
-
http://stackoverflow.com/questions/3118601/how-can-i-change-the-background-of-android-alert-dialogs – FuegoFingers Oct 20 '14 at 20:14
-
Try it here: [Dialog with transparent background in Android][1] [1]: http://stackoverflow.com/a/10795234/2423066 – jollyjoyce1995 Oct 20 '14 at 20:26
1 Answers
1
I was able to achieve my desired result by creating the Dialog and passing a style to its constructor like so...
Dialog ad = new Dialog(context, R.style.SpinnerDialogDropdown);
<style name="SpinnerDialogDropdown">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
**<item name="android:backgroundDimEnabled">false</item>**
</style>

raisedandglazed
- 804
- 11
- 29