【问题标题】:Set Specific Font in android actionBar在android actionBar中设置特定字体
【发布时间】:2014-02-05 11:03:57
【问题描述】:

我正在尝试在我的 Android 应用程序中设置无衬线细字体。 我可以在列表视图中设置它,现在我想在操作栏和设置微调器中做同样的事情,但我遇到了麻烦,任何人都可以帮助我吗?

谢谢

编辑:我在这里找到了解决方案 -> http://www.tristanwaddington.com/2013/03/styling-the-android-action-bar-with-a-custom-font/

编辑:关闭

【问题讨论】:

  • 我正在使用 values-14 文件夹中的 styles.xml ...我做得对吗?

标签: android fonts android-actionbar action typeface


【解决方案1】:

试试这个代码。

如果 (Build.VERSION.SDK_INT >= 11){

最终的ActionBar actionBar = getActionBar(); actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar_bg_warning)); actionBar.setTitle(Html.fromHtml("" + 字符串 + ""));

}

它设置了标题。 尝试在 XML 上添加标签 风格:"font-family="nome_font"

【讨论】:

    猜你喜欢
    • 2012-01-26
    • 1970-01-01
    • 1970-01-01
    • 2018-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-14
    相关资源
    最近更新 更多