【发布时间】:2013-03-09 23:53:13
【问题描述】:
我在自定义视图类中编写了这段代码 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 参数,以便我可以动态更改它们,我该怎么做?
【问题讨论】: