Android - Set drawable / layout of an extended Spinner

TheLolMan

New Member
I'd like to extend a Spinner in Android to be able do disable some of the possible items in the list the spinner offers. I achieved this. But now the layout of the spinner is quite ugly. See screenshot below here:http://www10.pic-upload.de/thumb/01.04.13/ulp5adxupy4.pngSo I would like to change the layout of the Spinner. The extended Spinner class looks like this:\[code\]public class PatchedSpinner extends Spinner {private boolean allItemsEnabled = true;private List<Integer> disabledOptions;private Context context;public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.context = context;}public PatchedSpinner(Context context) { super(context); this.context = context;}public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); this.context = context;}public void setDisabledOptions(List<Integer> list) { this.disabledOptions = list; this.allItemsEnabled = this.disabledOptions.size()==0 ? true : false;}private class DropDownAdapter implements ListAdapter, SpinnerAdapter {...}}\[/code\]This is my XML layout file:\[code\]<com.mypackage.util.PatchedSpinner android:id="@+id/someid" android:layout_width="150dp" android:layout_height="wrap_content" android:paddingLeft="10dp" android:background="@drawable/round_corners" android:textColor="@color/black" />\[/code\]How can I make the spinner look like e.g. a TextView, so without the greyish / greenish circle, simply displaying the selected text? THANKS!!
 
Back
Top