Ayush Dokania
Ayush Dokania

Reputation: 1

How to set scrollbar thumb and track in ExposedDropdownMenu

How can I give style to the scrollbar thumb and track in ExposedDropdownMenu? Also like padding and all.

Code:

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/dropDownContainer"
    style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
    android:layout_width="match_parent"
    android:layout_width="match_parent"
    android:layout_height="25dp"
    android:layout_marginHorizontal="17dp"
    android:layout_marginTop="8dp"
    app:boxBackgroundColor="@color/base_color"
    app:boxBackgroundMode="outline"
    app:boxCornerRadiusBottomEnd="8dp"
    app:boxCornerRadiusBottomStart="8dp"
    app:boxCornerRadiusTopEnd="8dp"
    app:boxCornerRadiusTopStart="8dp">

    <AutoCompleteTextView
        android:id="@+id/tvDropDown"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:inputType="none"
        android:padding="0dp"
        android:paddingTop="8dp"
        android:paddingStart="8dp"
        android:paddingEnd="0dp"
        android:text="drop down"
        android:textSize="9sp"
        android:dropDownVerticalOffset="3dp"
        android:dropDownHeight="132dp"
        app:fontFamily="@font/font_light"
        tools:ignore="LabelFor"/>

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

I am trying the below code but it is not working:

android:scrollbarThumbVertical="@drawable/scroll_bar_thumb_dropdown"
android:scrollbarTrackVertical="@drawable/scroll_bar_track_dropdown"

I want the scrollbar to be visible always, give thumb and track some color, and the scrollbar should have some right padding.

Upvotes: 0

Views: 13

Answers (0)

Related Questions