【发布时间】:2011-07-23 07:47:55
【问题描述】:
我有五个可绘制的矩形,我必须将矩形设置为 (-20,-15,-10,-5,0) 度角。每个矩形都有四种颜色阴影。现在我需要一个一个地为每个矩形设置动画,如果用户从左向右拖动,则顶部矩形从左向右移动。
问题是,我不能单独移动每个矩形。如何分别识别和实现每个矩形?
这里是我必须做的示例快照。 http://postimage.org/image/13sa96sbo/
public ColorFanDraw(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
@Override
protected void onDraw(Canvas canvasObject) {
int x = 100;
int y = 50;
int width = 70;
int convasSize =200;
Paint thePaint = new Paint();
thePaint.setColor(mTouchedColor-200);
canvasObject.rotate(-15, centerX,centerY);
canvasObject.drawRect(new Rect(x,y,x+width,y+convasSize), thePaint);
thePaint.setColor(mTouchedColor-50);
canvasObject.rotate(10, centerX,centerY);
canvasObject.drawRect(new Rect(x,y,x+width,y+convasSize), thePaint);
canvasObject.rotate(10, centerX,centerY);
thePaint.setColor(mTouchedColor);
canvasObject.drawRect(new Rect(x,y,x+width,y+convasSize), thePaint);
rotation = AnimationUtils.loadAnimation(contextObj,
R.anim.view_transition_in_left);
ImageView img = new ImageView(contextObj);
img.startAnimation(rotation);
}
【问题讨论】:
-
您的问题是什么?没有问题,没有答案......
标签: android image animation move draw