2012-10-10 37 views

回答

0

工作演示

TextView txt = (TextView) v.findViewById(R.id.custom_font); 

,然后更改字体

事情是这样的:

switch (position) { 
    case 0: 
      v = (LinearLayout) LayoutInflater.from(cxt).inflate(R.layout.lcmeter, null); 
      TextView txt = (TextView) v.findViewById(R.id.custom_font); 
      Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf"); 
      txt.setTypeface(font); 
      break; 
    } 
+2

不这样做这样 - 你的应用程序将内存泄漏是由于错误:http ://code.google.com/p/android/issues/detail?id = 9904 –

+0

好的。有用的链接。谢谢 –

+0

谢谢你们两位。 – Rahil2952

相关问题