The options in my spinner has different length and currently the dropdown arrow is positioned far to the right based on the longest option, as shown in the screenshot below.
Is it possible to move the dropdown arrow so that it is dynamically positioned based on currently selected option?
Especially when the first option is just 'All', it looks weird when the dropdown arrow is so far away to the right.
Referring to Google Translate App where dropdown arrow is always positioned next to its text:
Firstly set the background of the Spinner to @null to remove the default triangle:
Then create a layout resource spinner_item_main.xml with only a TextView which we can set a drawable by its right side (you can download the arrow picture from here):
Finally Set this layout resource when you initialize the Spinner, You can also provide a resource as the dropdown view (as what I have done):
(I use kotlin)
Make it! View this in My APP
Translating @尹小雨 answer to java