I have a counter with an array that is dynamically managed. when it is displayed, the spinner text also displays a switch. how do i get rid of this switch? the down arrow is not fixed, and yucky ... this is my problem. NOTE. I'm not talking about the switches that appear in the list that appears when I select drop down on the counter.
here is the corresponding code fragment ... a couple of points:
- this code is in the widget constructor, which is a subclass of Spinner
- value - an array of object instances (passed when creating the widget)
- no XML resources; all widgets are dynamically created.
- I think I need to "manipulate" the invitation, I added setPrompt (...) in the constructor, as well as in the onitemclicked event listener ... this did not affect.
Q: what am I missing? It seems to me that I'm missing some kind of Spinner attribute, which causes the switch to appear in the text part of the counter.
- snip code -
public class ChoiceGroupImpl extends Spinner implements OnItemSelectedListener { public ChoiceGroupImpl(Activity activity, WidgetContainer container, Value widget, AttributeImpl attributes, Object[] value, int selected) { ... adapter = new ArrayAdapter<CharSequence>(activity, R.layout.simple_spinner_dropdown_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); for (int i = 0; i < value.length; i++) adapter.add(value[i].toString()); if (attributes.isReadonly()) setEnabled(false); setAdapter(adapter); setSelection(selected); setPrompt(adapter.getItem(selected)); setOnItemSelectedListener(this); ... } public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { setPrompt(adapter.getItem(position)); ((ToolkitImpl) Toolkit.getInstance()).hiddenCommand(container, "SelectionChanged"); } ...
- end of snip code -
android radio-button button spinner
Sheshadri mantha
source share