Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I place spinner below the spinner layout when it is clicked and show spinner item in lollipop and above?

Like overflow menu overlaps the toolbar same way spinner overlaps itself when it is shown drop down item in lollipop and above android version. So I need to place it below the spinner view not over it.

like image 375
Vishal Makasana Avatar asked Nov 03 '15 05:11

Vishal Makasana


People also ask

How do you make a clickable spinner?

Try removing the xml attribute android:clickable="true" from the Spinner widget. It could be that the entire spinner is registering the click event rather than the individual spinner items.

What is set spinner show () method?

Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one.

How Use spinner in android app explain with example?

Android Spinner is a view similar to the dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it.

What is prompt in spinner android?

Android Spinner Search Hint Prompt Text And Background Color Example is for you. You will learn to set prompt programmatically and to change prompt text and background color. In android app, developer uses spinner to ask user to select any one choice from drop down menu or pop up dialog.


2 Answers

You can use

 android:overlapAnchor="false" 

This will show the dropdown below the spinner view (Work on api level 21 and higher).

like image 145
Victor Avatar answered Oct 05 '22 23:10

Victor


For all api use

 android:dropDownVerticalOffset="35dp" 

or whatever value that suits your needs.

like image 35
Zvi Avatar answered Oct 05 '22 23:10

Zvi