How do you underline a text in Android XML?

前端 未结 10 991
不思量自难忘°
不思量自难忘° 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:33

    I used below method, it worked for me. Below is example for Button but we can use in TextView as well.

    Button btnClickMe = (Button) findViewById(R.id.btn_click_me);
    btnClickMe.setPaintFlags(btnClickMe.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    

提交回复
热议问题