Didn"t forge 2011-06-01 11:41 采纳率: 83.3%
浏览 382
已采纳

设置 TextView 样式(粗体或斜体)

How to set TextView style (bold ot italic) with in Java and without using XML layout?

In other words I need to write android:textStyle with Java.

转载于:https://stackoverflow.com/questions/6200533/set-textview-style-bold-or-italic

  • 写回答

11条回答 默认 最新

  • from.. 2011-06-01 12:04
    关注
    textView.setTypeface(null, Typeface.BOLD_ITALIC);
    textView.setTypeface(null, Typeface.BOLD);
    textView.setTypeface(null, Typeface.ITALIC);
    textView.setTypeface(null, Typeface.NORMAL);
    

    To keep the previous typeface

    textView.setTypeface(textView.getTypeface(), Typeface.BOLD_ITALIC)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(10条)

报告相同问题?