Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Spacing or Padding in android Spinner

I'm using android spinner and edittext from support lib v21. I would like to align text to left the same like edittext as shown in figure. But, deafult spinner include spacing or padding. So, I would like to remove it to align text to left. Please help how to remove it.

enter image description here

like image 733
BomberBus Avatar asked Mar 20 '15 10:03

BomberBus


1 Answers

In your SpinnerAdapter:

@Override public View getView(int position, View convertView, ViewGroup parent) {         View view = super.getView(position, convertView, parent);         view.setPadding(0, view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());         return view; } 
like image 106
Chan Chun Him Avatar answered Sep 28 '22 06:09

Chan Chun Him