Closed petr-stety-stetka closed 5 years ago
Hi @petr-stety-stetka you can setSelection(-1)
which will clear the value and invoke the onNothingSelected
from the callback.
Take a look at the provided sample as example.
I think some better UI solution than separrate button for clearing, for example empty first item in dropdown.
You can easily achieve that behaviour by providing a clear option as one of the possible selections from the spinner. On the callback onItemSelected
if the position is the position of the clear option you just call setSelection(-1)
on the spinner.
For example:
if (position == 0) {
spinner.setSelection(-1);
}
if (position == 0) {
spinner.selection = -1
}
Hi,
Is some easy way, how select "none" in spinner? Thanks!
Petr