当前位置:首页 » 安卓系统 » 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);
}

热点内容
sqlserver连接测试 发布:2025-05-10 04:49:43 浏览:694
中国电信的电视维护密码是多少 发布:2025-05-10 04:36:52 浏览:589
苹果编译器叫什么名字 发布:2025-05-10 04:36:44 浏览:544
怎么给电话配置ip 发布:2025-05-10 04:31:40 浏览:359
java访问网站 发布:2025-05-10 04:31:02 浏览:189
linuxshell命令行 发布:2025-05-10 04:16:12 浏览:751
广东人社账号密码多少 发布:2025-05-10 03:43:11 浏览:617
python对象参数 发布:2025-05-10 03:43:11 浏览:576
自己服务器搭建梯子 发布:2025-05-10 03:31:39 浏览:574
华为升级包怎么解压 发布:2025-05-10 03:18:24 浏览:604