代码之家  ›  专栏  ›  技术社区  ›  Rona Idea

在textview字符串android中设置两种或更多字体

  •  -2
  • Rona Idea  · 技术社区  · 8 年前

    我有两种字体:

    Typeface typeface_font_arabic = Typeface.createFromAsset(context.getAssets(), "arial.ttf");
        Typeface typeface_font_number = Typeface.createFromAsset(context.getAssets(), "aclonica.ttf");
    

    如何在字符串TextView android中使用不同的字体?

    这是我的android代码

    示例: enter image description here

    1 回复  |  直到 8 年前
        1
  •  0
  •   IQ.feature    8 年前

    您可以使用“SpannableString”,点击此处:

    1. SpannableString example 2. How set Spannable object font with custom font