I want that my button looks like a spinner, because I will show a special dialog if the button is clicked. I use
Theme.MaterialComponents and tried following but it’s not working:
<Button android:id="@+id/btMusclegroups" style= "?spinnerStyle"// or style="@style/Widget.AppCompat.Spinner" android:layout_width="match_parent" android:layout_height="wrap_content" />
The button still looks solid and not like a spinner.
I want that my button looks the same as following
<Spinner android:id="@+id/btMusclegroups" android:layout_width="match_parent" android:layout_height="wrap_content" />
I could use a
OnTouchListener and a dummy adapter (I don’t need the adapter, my dialog knows all the data it needs already) but I’d prefer the above way – is this somehow achievable?
Create a container and add an image view containing the dropdown symbol for the spinner and a button. Add an OnClickListener to the button that calls the dialog and updates the text of the button. Don’t forget to style the button as NoBackground.