0

私のアプリケーションでは、JSON Web サービスを使用しています。Web サービスを通じて、テルグ語フォントを取得します。このテルグ語フォントをスピナーに追加するにはどうすればよいですか?

LayoutInflater lv = getLayoutInfalter();
View v = lv.inflate(R.layout.spineerfont,false);
TextView tv = (TextView)v.findViewById(R.id.sp);
Typeface faceGautami = Typeface.createFromAsset(getAssets(), "gautami.ttf");
tv.setTypeface(faceGautami);
4

1 に答える 1

0

およびで独自のカスタムSpinnerAdapterを使用してフォントを適用できます。getView()getDropDownView()

public View getView(int position, View convertView, ViewGroup parent) {

LayoutInflater inflater = getLayoutInflater();
View row = inflater.inflate(yourRowlayout, parent,false);
TextView make = (TextView) row.findViewById(R.id.sp);
Typeface myTypeFace = Typeface.createFromAsset(context.getAssets(),
            "fonts/gautami.ttf");
v.setTypeface(myTypeFace);
v.setText(itemList.get(position));
return row;
}


public View getDropDownView(int position, View convertView, ViewGroup parent) {

LayoutInflater inflater = getLayoutInflater();
View row = inflater.inflate(yourRowlayout, parent,false);
TextView make = (TextView) row.findViewById(R.id.sp);
Typeface myTypeFace = Typeface.createFromAsset(context.getAssets(),
            "fonts/gautami.ttf");
v.setTypeface(myTypeFace);
v.setText(itemList.get(position));
return row;
}
于 2013-11-07T07:28:51.033 に答える