如果是在資源文件里:
<resources> <string name="hello"><u>phone:0123456</u></string> <string name="app_name">MyLink</string></resources>
如果是代碼里:
TextView textView = (TextView)findViewById(R.id.tv_test); textView.setText(Html.fromHtml("<u>"+"0123456"+"</u>"));代碼也可以這樣:
tvTest.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下劃線tvTest.getPaint().setAntiAlias(true);//抗鋸齒
以上就是小編為大家帶來的android里TextView加下劃線的幾種方法總結全部內容了,希望大家多多支持武林網~
新聞熱點
疑難解答