Android drop-down list option box and indicator arrow animation
The Android native spinner provides a drop-down list option box, but in some popular apps, the native spinner seems to be less popular, and usually has a drop-down list option box as shown in the following figure:
Initialization status:
Click to pop up the drop-down selection option box:
When selected:
Pay attention to the indicating arrow. If the control is written more finely, the arrow should have animation rotation effect in the process of pull-down, selection and reset.
There are many implementation schemes of this style of selection box, which are common and commonly used. I wrote one myself. The code running result of the example I wrote is shown in the figure above.
The first is mainactivity.java:
Layout file:
The background of LinearLayout needs a rounded background RES / drawable / round_ corner_ line_ radius_ 3dp.xml:
Arrow icon.png:
Attachment: Android third-party open source drop-down box nicepinner
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.