I want to show the custom font In my Application. I want to show the custom font inside the spinner. For that I have used the custom adapter for creating the spinner.
I am getting the output that I want when spinner opens And I am getting the custom fonts. But when spinner close that time word is not readable font is not setting.
Image1: Inside the spinner the word is not readable.![enter image description here][1]
Image2: when spinner open the word is readable:
![enter image description here][2]
I have used the
**Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/kalpurush.ttf");**
**textViewlistview.setTypeface(tf);**
But how should I set the font inside the spinner. when settext inside the spinner.
[1]: http://i.stack.imgur.com/i02XA.png
[2]: http://i.stack.imgur.com/Vkydk.png
以下は、スピナーを使用しているアダプターです
private class CustomAdapterSpinner extends ArrayAdapter
{
public CustomAdapterSpinner() {
//super(context, android.R.layout.simple_spinner_item, objects);
super(CustomizeFontsAndroid.this, R.layout.simple_spinner1,R.id.textviewSpinner,strarraySpinner);
// TODO Auto-generated constructor stub
tf1=Typeface.createFromAsset(CustomizeFontsAndroid.this.getAssets(), "fonts/kalpurush.ttf");
}
@Override
public View getDropDownView(int position, View convertView,
ViewGroup parent) {
View view = super.getView(position, convertView, parent);
TextView textviewSpinner = (TextView)view.findViewById(R.id.textviewSpinner);
textviewSpinner.setTypeface(tf1);
textviewSpinner.setCompoundDrawables(null, null, null, null);
textviewSpinner.setTextSize(16);
textviewSpinner.setText(strarraySpinner[position].toString()+"\n");
//textviewSpinner.setText(R.string.bangla);
return view;
}
}//end of the Spinner Adapter