当前位置:首页 » 安卓系统 » android删除线

android删除线

发布时间: 2023-03-04 22:42:31

A. 如何改变在Android中删除线的颜色

I think this is not possible for simple textview so you have to do the following:-
1.Create a custom TextView by extending View class
2.Declare this custom textview inside XML layout same like we do for TextView.
And at last write an onDraw() method like following.

@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
paint.setColor(strikeThroughColor);
paint.setStyle(Paint.Style.FILL);
paint.setStrikeThruText(true);
paint.setStrokeWidth(strikeThroughWidth);
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
super.onDraw(canvas);
float width = getWidth();
float heigh = getHeight();
canvas.drawLine(width/10, heigh/10, (width-width/10),(heigh-heigh/10), paint);
}

热点内容
随机启动脚本 发布:2025-07-05 16:10:30 浏览:528
微博数据库设计 发布:2025-07-05 15:30:55 浏览:25
linux485 发布:2025-07-05 14:38:28 浏览:305
php用的软件 发布:2025-07-05 14:06:22 浏览:756
没有权限访问计算机 发布:2025-07-05 13:29:11 浏览:432
javaweb开发教程视频教程 发布:2025-07-05 13:24:41 浏览:707
康师傅控流脚本破解 发布:2025-07-05 13:17:27 浏览:243
java的开发流程 发布:2025-07-05 12:45:11 浏览:687
怎么看内存卡配置 发布:2025-07-05 12:29:19 浏览:285
访问学者英文个人简历 发布:2025-07-05 12:29:17 浏览:835