最近老是忘记这个画圆的参数是什么意思。记录一下省得每次都要百度。
/**
* <p>
* Draw the specified arc, which will be scaled to fit inside the specified oval.
* </p>
* <p>
* If the start angle is negative or >= 360, the start angle is treated as start angle modulo
* 360.
* </p>
* <p>
* If the sweep angle is >= 360, then the oval is drawn completely. Note that this differs
* slightly from SkPath::arcTo, which treats the sweep angle modulo 360. If the sweep angle is
* negative, the sweep angle is treated as sweep angle modulo 360
* </p>
* <p>
* The arc is drawn clockwise. An angle of 0 degrees correspond to the geometric angle of 0
* degrees (3 o'clock on a watch.)
* </p>
*
* @param oval The bounds of oval used to define the shape and size of the arc
* @param startAngle Starting angle (in degrees) where the arc begins
* @param sweepAngle Sweep angle (in degrees) measured clockwise
* @param useCenter If true, include the center of the oval in the arc, and close it if it is
* being stroked. This will draw a wedge
* @param paint The paint used to draw the arc
*/
public void drawArc(@NonNull RectF oval, float startAngle, float sweepAngle, boolean useCenter,
@NonNull Paint paint) {
super.drawArc(oval, startAngle, sweepAngle, useCenter, paint);
}
第一个参数RectF
RectF mArcRect = new RectF();
mArcRect.set(left, top,
left + arcDiameter, top + arcDiameter);
上下左右四个个参数是 指上下左右四个点,可以画出一个四边形
startAngle 开始的角度,起始角度为下午3点 用0表示
sweepAngle 画的圆角度 多大
useCenter 代表的是是否画出半径的意思,是就有半径,否就没画半径
最后一个参数是画笔,就不多说了