点線を描画するには PathEffect.dashPathEffect() を使う
- Canvas {
- drawRoundRect(
- color = color,
- cornerRadius = radius,
- style = Stroke(
- width = strokeWidth,
- pathEffect = PathEffect.dashPathEffect(
- intervals = floatArrayOf(onInterval, offInterval),
- phase = onInterval + offInterval,
- )
- )
- )
- }
Canvas {
drawRoundRect(
color = color,
cornerRadius = radius,
style = Stroke(
width = strokeWidth,
pathEffect = PathEffect.dashPathEffect(
intervals = floatArrayOf(onInterval, offInterval),
phase = onInterval + offInterval,
)
)
)
}
0 件のコメント:
コメントを投稿