i\'m going to change text typeface to arialbold in my spinner how i\'m going to do so. Below is my code :-
ArrayAdapter genderAdap = Arra
Here is how you can do it, set your adapter as below:
mMsgAdap =new ArrayAdapter(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);
and the typeface method I have taken statically inside StaticUtils class that I created is
public static Typeface sTypeFace(Context mCnxt) {
Typeface mtypeface = Typeface.createFromAsset(mCnxt.getAssets(),
"fonts/forte-mt-1361539051.ttf");
return mtypeface;
}