當前位置:首頁 » 安卓系統 » 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 瀏覽:529
微博資料庫設計 發布:2025-07-05 15:30:55 瀏覽:26
linux485 發布:2025-07-05 14:38:28 瀏覽:306
php用的軟體 發布:2025-07-05 14:06:22 瀏覽:757
沒有許可權訪問計算機 發布:2025-07-05 13:29:11 瀏覽:433
javaweb開發教程視頻教程 發布:2025-07-05 13:24:41 瀏覽:709
康師傅控流腳本破解 發布:2025-07-05 13:17:27 瀏覽:244
java的開發流程 發布:2025-07-05 12:45:11 瀏覽:689
怎麼看內存卡配置 發布:2025-07-05 12:29:19 瀏覽:286
訪問學者英文個人簡歷 發布:2025-07-05 12:29:17 瀏覽:835