2013-03-15 47 views
1

我是新的android开发人员,我正在设计这种类型的应用程序,在我的应用程序中,我希望在设计时看到textview的实际外观,在eclipse中更改不同的字体**。在设计时更改textview字体类型在android中

在这里,我举一个例子。

enter image description here

请帮帮我有什么办法可以看到不同的字体风格在设计时?

回答

3

您可以使用TTF font这一点。您需要下载并将其放置在assets文件夹中,然后使用Typeface进行设置。您必须根据项目需求在运行时间进行管理。

TextView tv=(TextView)findViewById(R.id.tv); 
Typeface face=Typeface.createFromAsset(getAssets(), "fonts/Alan Den.ttf"); 
tv.setTypeface(face); 

希望这会工作,对于任何查询,让我know.Good运气

+0

我想在设计时的变化。 – Hemant 2013-03-15 07:38:55

+0

你不能,因为没有更多的选项只有sens,serif,normal和monospace。更多外观http://developer.android.com/reference/android/widget/TextView.html#attr_android:typeface – Dilip 2013-03-15 07:42:00

相关问题