【发布时间】:2022-12-02 11:10:19
【问题描述】:
Want to do
I want to change the default background color of AlertDialog from translucent to transparent.
I don't want to change the color of white place.
What I tried
AddedstyletoAlertDialog.Builder. However, this code changed the background not only translucent but also white place.
styles.xml
<style name="TransparentDialogTheme" parent="@android:style/Theme.Light">
<item name="android:windowNoTitle">false</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
MainActivity.cs
var layout = LayoutInflater.Inflate(Resource.Layout.dialog_eventLogOptionMenu, null);
var dlg = new AndroidX.AppCompat.App.AlertDialog.Builder(this, Resource.Style.TransparentDialogTheme).Create();
【问题讨论】:
标签: c# android xamarin xamarin.android android-alertdialog