How to set underline text on textview?

后端 未结 12 1196
慢半拍i
慢半拍i 2020-12-23 17:42

How to set underline text on textview?

I have used following code but it is not working.

tvHide.setText(Html.fromHtml("

12条回答
  •  滥情空心
    2020-12-23 17:49

    You can easily add a View with the height of 1dp aligning start and the end of TextView, right below it. You can also use marginTop with negative value to make the underline closer to TextView. If you use your TextView and the under inside a relative layout, it would be much easier for alignments. here is the example:

    
    
    
    
    
    
    

提交回复
热议问题