1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
class CustomAdapter<T> extends ArrayAdapter<T> {
public CustomAdapter(Context context, int textViewResourceId,
T[] objects) {
super(context, textViewResourceId, objects);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
if (view instanceof TextView) {
((TextView) view).setTextSize(SIZE_title_form);
((TextView) view).setTypeface(myTypeface);
}
return view;
}
public View getCustomView(int position, View convertView,
ViewGroup parent) {
// TODO Auto-generated method stub
// return super.getView(position, convertView, parent);
View v = convertView;
if (v == null) {
LayoutInflater inflater = getLayoutInflater();
v = inflater.inflate(R.layout.spinner_dropdown_item, parent, false);
}
TextView tt = (TextView) v.findViewById(android.R.id.text1);
tt.setTextSize(SIZE_title_form);
tt.setTextColor(Color.BLACK);
tt.setTypeface(myTypeface);
// label.setText(DayOfWeek[position]);
//
// ImageView icon=(ImageView)row.findViewById(R.id.icon);
// icon.setImageResource(image[position]);
return v;
} |
Partager