TextView加上划线、粗体
TextView加下划线、粗体
如果是在资源文件里,可以这样写
Java代码 :
<resources>
<string name="hello"><u>phone: 1390123456</u></string>
<string name="app_name">MyLink</string>
</resources>
如果是代码这样写.
Java代码 :
TextView textView = (TextView)findViewById(R.id.testView);
textView.setText(Html.fromHtml("<u>"+"hahaha"+"</u>"));
粗体:
TextView text = new TextView(context);
text.getPaint().setFakeBoldText(true);
如果是在资源文件里,可以这样写
Java代码 :
<resources>
<string name="hello"><u>phone: 1390123456</u></string>
<string name="app_name">MyLink</string>
</resources>
如果是代码这样写.
Java代码 :
TextView textView = (TextView)findViewById(R.id.testView);
textView.setText(Html.fromHtml("<u>"+"hahaha"+"</u>"));
粗体:
TextView text = new TextView(context);
text.getPaint().setFakeBoldText(true);