I found a function for rectangles with all 4 corners being round, but I want to have just the top 2 corners round. What can I do?
canvas.drawRoundRect(new Re
you can easily achieve this by using Path:
val radiusArr = floatArrayOf( 15f, 15f, 15f, 15f, 0f, 0f, 0f, 0f ) val myPath = Path() myPath.addRoundRect( RectF(0f, 0f, 400f, 400f), radiusArr, Path.Direction.CW ) canvas.drawPath(myPath, paint)