BitOfaLegend
BitOfaLegend

Reputation: 69

How do I change the boxBackgroundColor of TextInputLayout dropdown while selected?

So I want a transparent box background color even while my dropdown is selected, but by default it is being tented to darker color.. Check out the images below.

Not selected ![(https://i.sstatic.net/njkfx.png)

Selected ![(https://i.sstatic.net/njkfx.png)

Here's my code

<com.google.android.material.textfield.TextInputLayout
            android:id="@+id/type_dropdown_container"
            style="@style/DialogDropdown"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:hint="@string/type"
            android:textAlignment="textStart"
            android:theme="@style/DialogTextInputTheme"
            app:boxBackgroundMode="outline"
            app:helperText="Required"
            app:helperTextTextColor="@android:color/holo_red_light">

            <AutoCompleteTextView
                android:id="@+id/type_dropdown_textview"
                style="@style/DialogInput"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:inputType="none"
                tools:ignore="LabelFor" />
</com.google.android.material.textfield.TextInputLayout>

Any ideas on how I can remove the tint?

Upvotes: 0

Views: 201

Answers (1)

Nikhil Bingradiya
Nikhil Bingradiya

Reputation: 1

<com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_marginEnd="8dp"
                    android:hint="@string/months_at_employment_hint"
                    app:boxBackgroundColor="@color/white">
    
                    <AutoCompleteTextView
                        android:id="@+id/months_at_employment_selection"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />
    
                </com.google.android.material.textfield.TextInputLayout>

Upvotes: 0

Related Questions