使用Android中的自定义字体自定义、字体、Android

2023-09-11 11:10:55 作者:_Smileヾ似懂非懂

我要使用自定义字体为我而我创建Android应用程序。 我可以单独改变从code每个对象的字体,但我有数百人。

因此​​,

有没有办法从XML做到这一点? [设置自定义字体] 有没有办法从code做在一个地方,说整个应用和所有的组件应该使用,而不是默认的?自定义字体

感谢。 - codevalley

解决方案   

有没有办法从做   XML?

没有,对不起。您只能通过XML指定内置字体。

  

有没有办法从code做的   一处,以说,整个   应用和所有组件   应使用自定义的字体,而不是   默认吗?

这并不是说我知道。

I want to use a custom font for my android application which I am creating. I can individually change the typeface of each object from Code, but I have hundreds of them.

android 自定义id,Android自定义字体类库Calligraphy 快速实现自定义应用字体

So,

Is there a way to do this from the XML? [Setting a custom typeface] Is there a way to do it from code in one place, to say that the whole application and all the components should use the custom typeface instead of the default one?

Thanks. -Codevalley

解决方案

Is there a way to do this from the XML?

No, sorry. You can only specify the built-in typefaces through XML.

Is there a way to do it from code in one place, to say that the whole application and all the components should use the custom typeface instead of the default one?

Not that I am aware of.