2017-08-24 53 views
-1

所以我想改变Android中的fontFamily,但我想使用不同的字体家族的标题和子文本。我可以实现它..?如何更改android中的fontFamily文本视图

+1

[如何改变的Android TextView中的fontFamily中](HTTPS的可能重复://stackoverflow.c OM /问题/ 12128331 /如何对变化fontFamily中-的-TextView的功能于机器人) – 0X0nosugar

回答

0
<TextView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:text="Enter the password :" 
    android:textColor="#000000" 
    android:fontFamily="sans-serif" 
    android:layout_marginTop="75dp"/> 
0

如果你想使用不同的字体未在字体家庭速效,那么你可以从互联网上,字体,然后

把你的字体资产的文件夹,然后从中

创建新的字体

下面是一个例子

TextView txt = (TextView) findViewById(R.id.custom_font); Typeface font = Typeface.createFromAsset(getAssets(), "SomeFont.ttf"); txt.setTypeface(font);

相关问题