我有层次结构:
Buttons (Button childs)
myView (View child)
RelativeView (has background image)
在 myView 中,我绘制了具有动画的圆圈(缩放 0.5 到 1.0 大小),它的性能非常低(绘制速度非常慢)
我不能使用surfaceview,因为surfaceview在任何视图下都不能透明,如果它是
透明的,它必须是 surface.setZOrderOnTop(true);
该怎么办?
附言
绘图代码
// Square is Button that need to has animated circle under it
for (int i = 0; i < squares.size(); i++) {
Square square = squares.get(i);
if (square.animIndex == -1)
continue;
int left = square.getLeft();
int top = getRelativeTop(square);
int w = (int) (square.animIndex * square.getMeasuredWidth() * 4 / 10f);
square.animIndex++;
if (square.animIndex > 10) {
square.animIndex = -1;
}
//note is circle bitmap
c.drawBitmap(note, null, new Rect(left - w / 2 + square.getMeasuredWidth() / 2, top - w / 2
+ square.getMeasuredHeight() / 2, left - w / 2 + square.getMeasuredWidth() / 2 + w, top
- w / 2 + square.getMeasuredHeight() / 2 + w), null);
}