Browsed by
Tag: custom spinner

Android Custom spinner .

Android Custom spinner .

Step -1 : Create new Adapter . public class CustomSpinnerAdapter extends BaseAdapter implements SpinnerAdapter { private final Context context; private ArrayList<String> asr; public CustomSpinnerAdapter(Context context1, ArrayList<String> asr) { this.context = context1; this.asr=asr; } public int getCount() { return asr.size(); } public Object getItem(int i) { return asr.get(i); } public long getItemId(int i) { return (long)i; } @Override public View getDropDownView(int position, View convertView, ViewGroup parent) { TextView txt = new TextView(context); txt.setPadding(16, 16, 16, 16); txt.setTextSize(18); txt.setGravity(Gravity.CENTER_VERTICAL); txt.setText(asr.get(position)); txt.setTextColor(Color.parseColor(“#000000”)); return…

Read More Read More