我希望能够以编程方式绘制一些内容,将其设置为
我需要的是能够使用起始角度和结束角度绘制彩色区域的工具。这种工具是否可行?
ImageView
的背景。它应该看起来像这样:。所以它有点像饼图,但它不是饼图。我找到了一些可以在圆圈中绘制圆圈的东西: ShapeDrawable biggerCircle= new ShapeDrawable( new OvalShape());
biggerCircle.setIntrinsicHeight( 60 );
biggerCircle.setIntrinsicWidth( 60);
biggerCircle.setBounds(new Rect(0, 0, 60, 60));
biggerCircle.getPaint().setColor(Color.BLUE);
ShapeDrawable smallerCircle= new ShapeDrawable( new OvalShape());
smallerCircle.setIntrinsicHeight( 10 );
smallerCircle.setIntrinsicWidth( 10);
smallerCircle.setBounds(new Rect(0, 0, 10, 10));
smallerCircle.getPaint().setColor(Color.BLACK);
smallerCircle.setPadding(50,50,50,50);
Drawable[] d = {smallerCircle,biggerCircle};
LayerDrawable composite1 = new LayerDrawable(d);
btn.setBackgroundDrawable(composite1);
我需要的是能够使用起始角度和结束角度绘制彩色区域的工具。这种工具是否可行?