简体   繁体   English

如何在 TextView 中动态更改字体样式?

[英]How to change font Style Dynamically in TextView?

i am new to android, please help me我是 android 的新手,请帮帮我

in my application i want to enter text on image and i want to change the text Font dynamically how it will be do in TextView,在我的应用程序中,我想在图像上输入文本,并且我想动态更改文本字体,它将如何在 TextView 中执行,

please give suggestions.请提出建议。

Try this,尝试这个,

  Typeface tf = Typeface.createFromAsset(getAssets(),
        "fonts/Arial.otf");
    TextView tv = (TextView) findViewById(R.id.CustomFontText);
    tv.setTypeface(tf)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM