I am new to android and I would like to know how to add a button to a toolBar and on Click of the button, I would like to open a Spinner.
Thanks
I am new to android and I would like to know how to add a button to a toolBar and on Click of the button, I would like to open a Spinner.
Thanks
Since the spinner dropdown is not like the new LollyPop Design like Spinner:
So you need to add small code for the spinner control
android:dropDownVerticalOffset="-52dp" for Kitkat and below
android:dropDownVerticalOffset="0dp" for LollyPop
<Spinner
android:id="@+id/spinner_nav"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:dropDownVerticalOffset="@dimen/dropDownVerticalOffset" />
-> For more detail with example, visit the link :-
http://android-pratap.blogspot.in/2015/01/spinner-in-toolbar-example-in-android.html
its very easy Spinner before = (Spinner) findViewById(R.id.beforeSpinner); before.performClick();
it will open your spinner