TextView划线android
2015-10-23 11:29
477 查看
TextView 加下划线 、 中划线
下过如图:
// 中划线
view
sourceprint?
// 下划线
view
sourceprint?
//取消设置的线
view
sourceprint?
我封装了几个方法 直接调用
view
sourceprint?
下过如图:
// 中划线
view
sourceprint?
1.
textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
// 设置中划线并加清晰
// 下划线
view
sourceprint?
1.
textView.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
//取消设置的线
view
sourceprint?
1.
textView.getPaint().setFlags(
0
);
// 取消设置的的划线
我封装了几个方法 直接调用
view
sourceprint?
01.
/**
02.
* 下划线
03.
*
04.
* @param textView
05.
*/
06.
private
void
addButtomLine(TextView textView) {
07.
textView.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
08.
}
09.
10.
/**
11.
* 移除线
12.
*
13.
* @param textView
14.
*/
15.
private
void
removeLine(TextView textView) {
16.
textView.getPaint().setFlags(
0
);
// 取消设置的的划线
17.
18.
}
19.
20.
/**
21.
* 设置中划线并加清晰
22.
*
23.
* @param textView
24.
*/
25.
private
void
addLine(TextView textView) {
26.
textView.getPaint().setFlags(
27.
Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
// 设置中划线并加清晰
28.
29.
}
30.
31.
/**
32.
* 中划线
33.
*
34.
* @param textView
35.
*/
36.
private
void
addCenterLine(TextView textView) {
37.
textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
// 中划线
38.
}
39.
40.
/**
41.
* 抗锯齿
42.
*
43.
* @param textView
44.
*/
45.
private
void
addjuchiLine(TextView textView) {
46.
textView.getPaint().setAntiAlias(
true
);
// 抗锯齿
相关文章推荐
- android控制soundpool播放音量
- Android开发学习笔记:用Intent调用系统中经常被用到的组件
- Android Parcelable接口
- Android] setContentView和inflater区别以及findViewById和inflater的区别
- This version of the rendering library is more recent than your version of ADT plug-in. Please updat
- Meterial 属性总结
- Android本地数据存储之Sharedpreference
- 移动开发新选择 使用javascript开发iOS和Android原生应用
- android开发游记:textview超过长度点击展开自动滚动(在一个TextView中实现,不增加布局复杂度)
- Android/Java回调机制带来的内存回收问题
- android 防止旋转时销毁重建activity
- android--适配器模式
- Android 将asserts文件夹内文件写入SD卡中
- android动画-View Animation的一些基本效果
- Android 版本自动更新
- android自定义view-仿小红书标签
- android动画- Property Animation(下)
- Android屏幕适配全攻略(最权威的官方适配指导)
- Android中获取应用程序(包)的信息-----PackageManager的使用(一)
- Android开发之Service的写法以及与Activity的通信