How to Underline Text of Button in Android?

前端 未结 5 921
鱼传尺愫
鱼传尺愫 2020-12-23 20:58

I have a button which is transparent and has an icon and text.

I want to underline the text of the button but i have not been able to do this.

Below is my

5条回答
  •  一生所求
    2020-12-23 21:26

    Button button= (Button) findViewById(R.id.park);
    SpannableString content = new SpannableString("Content");
    content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
    button.setText(content);
    

提交回复
热议问题