How do you underline a text in Android XML?

前端 未结 10 1008
不思量自难忘°
不思量自难忘° 2020-12-04 14:57

How do you underline a text in an XML file? I can\'t find an option in textStyle.

10条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 15:23

    
        This is an underline.
    
    

    If it does not work then

    
    This is an <u>underline</u>.
    

    Because "<" could be a keyword at some time.

    And for Displaying

    TextView textView = (TextView) view.findViewById(R.id.textview);
    textView.setText(Html.fromHtml(getString(R.string.your_string_here)));
    

提交回复
热议问题