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

前端 未结 11 641
借酒劲吻你
借酒劲吻你 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条回答
  •  余生分开走
    2020-12-02 04:32

    I don't know about underline, but for bold and italic there is "bolditalic". There is no mention of underline here: http://developer.android.com/reference/android/widget/TextView.html#attr_android:textStyle

    Mind you that to use the mentioned bolditalic you need to, and I quote from that page

    Must be one or more (separated by '|') of the following constant values.

    so you'd use bold|italic

    You could check this question for underline: Can I underline text in an android layout?

提交回复
热议问题