android里TextView加下划线的三种方式
2016-11-24 15:37
302 查看
第一种,在strings.xml 文件中实现
<resources> <string name="diary_forget_pwd"><u>| 忘记密码 </u></string> </resources>
第二种,在代码中动态指定文字
forgotpwdTxt = (TextView) thisView.findViewById(R.id.diary_forget_pwd);forgotpwdTxt.setText(Html.fromHtml("<u>"+"| 忘记密码"+"</u>"));第三种,在代码中,直接修改TextView的属性
forgotpwdTxt = (TextView) thisView.findViewById(R.id.diary_forget_pwd);forgotpwdTxt.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG );
forgotpwdTxt.getPaint().setAntiAlias(true);//抗锯齿,不知效果如何
相关文章推荐
- android里TextView加下划线的几种方式
- Android TextView 添加下划线的几种方式
- Android TextView加下划线的几种方式
- Android TextView实现带链接文字事件监听的三种常用方式示例
- Android TextView 添加下划线的几种方式
- android里TextView加下划线的几种方式 以及 为TextView添加边框 4000
- [Android 小知识点] textview 设置下划线的两种方式
- Android TextView 添加下划线的几种方式
- Android 自定义View中drawText获取text宽度的三种方式
- Android TextView 添加下划线的几种方式
- Android TextView 添加下划线的几种方式
- Android自定义View初体验,实现圆形TextView的三种方式
- Android TextView 添加下划线的几种方式
- Android自定义View初体验,实现圆形TextView的三种方式
- Android TextView 添加下划线的几种方式
- android里TextView加下划线的几种方式
- Android TextView 添加下划线的几种方式
- android里TextView加下划线的几种方式
- Android里TextView加下划线的几种方式
- Android TextView 显示不全的自动补齐方式