我想在一个圆内画一个较小的圆。这似乎很简单,但我遇到了麻烦,找不到答案。我正在使用的代码是:
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);
LayerDrawable composite1 = new LayerDrawable(new Drawable[] biggerCircle,smallerCircle,});
但是那样并不起作用,小圆圈会变得和大圆圈一样大。所以唯一显示的是一个大小为biggerCircle的黑色圆圈。如果有人能帮忙,我将不胜感激。先谢谢了。