我在我的自定义视图类中编写了这段代码 protected void onDraw(Canvas canvas) {
Paint p1 = new Paint();
p1.setStyle(Style.FILL);
p1.setColor(Color.BLACK);
p1.setAntiAlias(true);
RectF rect1 = new RectF(canvas.getWidth()/2,500, canvas.getWidth() ,canvas.getHeight() );
canvas.drawRoundRect(rect1, 4, 4, p1);
super.onDraw(canvas);
}
我想访问rect1
我活动中的参数,以便动态更改它们,我该怎么做?