Вот как вы можете сделать это, установите адаптер, как показано ниже:
mMsgAdap =new ArrayAdapter<CharSequence>(getApplicationContext(), R.layout.spinner_item_list, mCategories)
{
public View getView(int position, View convertView, ViewGroup parent)
{
View v = super.getView(position, convertView, parent);
((TextView) v).setTypeface(StaticUtils.sTypeFace(getApplicationContext()));//Typeface for normal view
return v;
}
public View getDropDownView(int position, View convertView, ViewGroup parent)
{
View v = super.getDropDownView(position, convertView, parent);
((TextView) v).setTypeface(StaticUtils.sTypeFace(getApplicationContext()));//Typeface for dropdown view
((TextView) v).setBackgroundColor(Color.parseColor("#BBfef3da"));
return v;
}
};
mMsgAdap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mMsgSpnr.setAdapter(mMsgAdap);
mMsgSpnr.setSelection(0);
и методы гарнитура Я взял статический внутри класса StaticUtils, что Я создал это
public static Typeface sTypeFace(Context mCnxt) {
Typeface mtypeface = Typeface.createFromAsset(mCnxt.getAssets(),
"fonts/forte-mt-1361539051.ttf");
return mtypeface;
}
я попробовать это до сих пор не работает. После кода я добавляю 'adapter.setDropDownViewResource (R.layout.spinner_item); \t \t ddlGender.setAdapter (адаптер); ' – nick
can u plz сообщите мне об ошибке? – KOTIOS
нет ошибки просто счетчик пустых данных – nick