I don't want to make the wallpaper blurry when I sing the dialog.

Asked 2 years ago, Updated 2 years ago, 104 views

    <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>

This is the UserInputDialog that I made. When you pop up the dialog, the background gets blurry. Is it possible to get rid of it?

android dialog views

2022-09-22 22:33

1 Answers

Go to style.xml file

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

Please add And go to the manifest file and <activity android:name=".SampleActivity" android:theme="@style/Theme.DoNotDim">Add android:theme.


2022-09-22 22:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.