public class PentacleView extends View {
private static String TAG = "AngleView";
private int defaultWidth = 30;
private int defaultHeight = 30; //view的默认宽高
private int mCenterX;
private int mCenterY; //view的中心点
private int mBackgroudColor;
private int mPaintColor;
private int mRotation; //五角星旋转角度
private Paint mPaint;
private Path mPath;
public PentacleView(Context context) {
this(context, null);
}
public PentacleView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public PentacleView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
mBackgroudColor = Color.RED;
mPaintColor = Color.YELLOW;
mRotation = 0;
if(mPaint == null)
mPaint = new Paint();
if
自定义View画五角星
最新推荐文章于 2023-02-27 00:03:35 发布