Android drop-down list

Renderings:

 

An example masters a knowledge point.

step:

1. First create an xml to write the layout, such as

 2. Customize a layout to display the content in the spinner. Customize the layout steps: Right-click project=>right-click layout=>click new=>click layout resource file, fill in TextView for the root element, and choose the name as you like. like

 3. Find the corresponding java file, then implement the AdapterView.OnItemSelectedListener interface, and rewrite the onItemSelected() and onNothingSelected() methods, such as

 

Guess you like

Origin blog.csdn.net/m0_67982986/article/details/131025736