更改Android应用程序的所有字体

更改Android应用程序的所有字体,第1张

概述参见英文答案 > Is it possible to set a custom font for entire of application?                                    24个 如何更改Android应用程序的整个字体? 之前我在github上看过 this post.该解决方案仅适用于低于api 21的设备. 对于android 5,即使我们分别使用s 参见英文答案 > Is it possible to set a custom font for entire of application?                                    24个
如何更改AndroID应用程序的整个字体?
之前我在github上看过 @L_301_1@.该解决方案仅适用于低于API 21的设备.
对于androID 5,即使我们分别使用styles.xml添加values-v21文件夹,此方法也不起作用.

这是我的值-v21 / styles.xml:

<resources>    <style name="AppBasetheme" parent="theme.AppCompat.light.DarkActionbar">    </style>    <style name="Apptheme" parent="AppBasetheme">        <item name="androID:typeface">serif</item>    </style></resources>
解决方法
<style name="Apptheme" parent="AppBasetheme">    <item name="androID:textVIEwStyle">@style/RobotoTextVIEwStyle</item>    <item name="androID:buttonStyle">@style/RobotobuttonStyle</item></style><style name="RobotoTextVIEwStyle" parent="androID:Widget.TextVIEw">    <item name="androID:FontFamily">sans-serif-light</item></style><style name="RobotobuttonStyle" parent="androID:Widget.Holo.button">    <item name="androID:FontFamily">sans-serif-light</item></style>

然后将主题应用到您的应用

<application    androID:theme="@style/Apptheme" ></application>
@H_502_32@ 总结

以上是内存溢出为你收集整理的更改Android应用程序的所有字体全部内容,希望文章能够帮你解决更改Android应用程序的所有字体所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1125528.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存