How to set the font style to bold, italic and underlined in an Android TextView?

前端 未结 11 581
借酒劲吻你
借酒劲吻你 2020-12-02 04:04

I want to make a TextView\'s content bold, italic and underlined. I tried the following code and it works, but doesn\'t underline.



        
11条回答
  •  -上瘾入骨i
    2020-12-02 04:35

    This is an easy way to add an underline, while maintaining other settings:

    textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    

提交回复
热议问题