Android Spinner Items As A Grid
By default when Spinner is clicked, items are showed as list. I want to change the items showed as grid. How can I do that? I just need some direction. Thanks UPDATE: This is my co
Solution 1:
You need to override getDropDownView
method of your Spinner
to show the GridView
.
And in order to select values out from your Spinner
, use OnItemClickListener
on your GridView
to get callbacks. for example:
label.setOnItemClickListener(new OnItemClickListener() {
publicvoidonItemClick(AdapterView<?> parent, View v, int pos, long id) {
Toast.makeText(getContext(), "" + pos, Toast.LENGTH_SHORT).show();
}
});
Post a Comment for "Android Spinner Items As A Grid"