Skip to content Skip to sidebar Skip to footer

Changing The Arrow Color Material Exposeddropdownmenu / Textinputlayout

I want to change the arrow color to white. how to do it? here's my code

Solution 1:

You can use the app:endIconTint attribute in the layout:

<com.google.android.material.textfield.TextInputLayout...app:endIconTint="@color/my_selector_color">

or you can use a custom style:

<com.google.android.material.textfield.TextInputLayoutstyle="@style/ExposedDropdownMenu"...>

with:

<stylename="name="ExposedDropdownMenu" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"><itemname="endIconTint">@color/my_selector_color</item></style>

Solution 2:

Simply add endIconTint attribute to the TextInputLayout by using

app:endIconTint="@color/primaryDarkColor"

where

@color/primaryDarkColor

is your desired color of choice

Example below with full XML Code


        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/til_paying_bank"
            style = "@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/til_withdrawal_date"
            android:layout_centerHorizontal="true"
            android:padding="5dp"
            app:endIconTint="@color/primaryDarkColor">

            <AutoCompleteTextView
                android:id="@+id/actv_paying_bank"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/paying_bank"
                android:dropDownSelector="@color/primaryLightColor"
                />

        </com.google.android.material.textfield.TextInputLayout>

Solution 3:

If you want change drawable, not only color, you can set endIconDrawable. For drawable put a selector xml like this:

<selectorxmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:drawable="@drawable/ic_page_up"android:state_checked="true"/><itemandroid:drawable="@drawable/ic_page_down"/></selector>

Post a Comment for "Changing The Arrow Color Material Exposeddropdownmenu / Textinputlayout"