MaterialSpinner
MaterialSpinner copied to clipboard
Add ability to config spinner with non-selected state.
I my case I need to have a spinner with a no selected item from the data source(With empty field). So that users could select any item from all data sources.
u mean at the first no data was selected ?
Yes
ok let me check . . u can create object with zero or null value at first . then add this value to ur spinner like this . for example u have Array List like this :
private static final String[] IRAN_TOWN = { "Tehran", "Isfahan", "Tabriz", }; MaterialSpinner spinner = (MaterialSpinner) findViewById(R.id.spinner); String[] BlankItem = new String[IRAN_TOWN.length + 1]; System.arraycopy(IRAN_TOWN, 0, BlankItem , 1, IRAN_TOWN.length); BlankItem [0] = ""; spinner.setItems(BlankItem);
i hope it helps ;)
Thanks for the solution but it seems like a crutch because after the user will select a second item then in second time spinner will show the next list of items: " ", "Tehran", "Tabriz". Maybe I'm looking for a solution which is directly in the library. I'm using this spinner in my production project many times and I'm looking for a clear solution.