2021年7月26日月曜日

Jetpack Compose : 点線を描画する

点線を描画するには PathEffect.dashPathEffect() を使う
  1. Canvas {  
  2.     drawRoundRect(  
  3.         color = color,  
  4.         cornerRadius = radius,  
  5.         style = Stroke(  
  6.             width = strokeWidth,  
  7.             pathEffect = PathEffect.dashPathEffect(  
  8.                 intervals = floatArrayOf(onInterval, offInterval),  
  9.                 phase = onInterval + offInterval,  
  10.             )  
  11.         )  
  12.     )  
  13. }  


0 件のコメント:

コメントを投稿