As you create your app, you might want to present specific data in a spinner. This could be something like a choice of countries or currency options. This tutorial will show you how to:
1. Create a String list
2. Display data in a spinner
Step 1.
Create a new project and add a spinner widget. Simply drag it onto your project screen. If you have nothing on your screen it will look like it does in the picture below
Once you have added the Spinner widget navigate to the onCreate event to set your spinner data.
In your onCreate event create a String list. Simply follow the arrows.
Some new blocks will appear. Place your blocks like I have done in the image below. You can replace the text with your own custom text. Simply click that white space and type your own list characters.
Remember: If you're having trouble finding your blocks, simply use the colours to guide you.
Place a setSpinnerData below your add blocks. Choose your spinner... in this case its spinner1 and our list string is mylist.
Comments