Drop down menu for Android?« Back to Questions List

Please help me to add drop down in Android, thanks.

Asked by tharindu
Added June 16, 2016 8:05 pm

Do you have the right answer? If you do other users will benefit from your contribution, share your knowledge with the community!

Hi, this is easy to do with Class Tag.

Step 1 – Create the Spinner

${class|Spinner:android:entries="@array/country_arrays"} my dropdown

You may need to add additional props in the export due to the max char limit in PSD layer names

– After your export –

Step 2 – add your string values

<string-array name="country_arrays">
	<item>Malaysia</item>
	<item>United States</item>
	<item>Indonesia</item>
	<item>France</item>
	<item>Italy</item>
	<item>Singapore</item>
	<item>New Zealand</item>
	<item>India</item>
</string-array>

Step 3 – in Java add an event listener to the spinner

my_dropdown.setOnItemSelectedListener(new MyOnItemSelectedListener());
Answer by admin
Answered On June 16, 2016 8:07 pm #
Looking for another answer? View other questions in Android or get premium support for guaranteed results.
Asked by tharindu
1696 views
1 answer
Last Answered 9 years ago by admin

Categories

Recent Answers

asked by rihabbenhmida
asked by zaineb khiari
asked by nmax
asked by shanrt
[+] View All Recent Questions

Share Your Knowledge!

Contribute to the community and help other users to benefit from your answer with experience and knowledge.