@Override
protected void dispatchDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.dispatchDraw(canvas);
int count = getChildCount();
int top = count>0 ? getChildAt(0).getTop() : 0;
int backgroundWidth = background.getWidth();
int backgroundHeight = background.getHeight();
int width = getWidth();
int height = getHeight();
int childHeight=getChildAt(0).getHeight()*2;
for (int y = top; y<childHeight; y += backgroundHeight){
for (int x = 0; x<width; x += backgroundWidth){
canvas.drawBitmap(background, x, y, null);
}
}
super.dispatchDraw(canvas);
}
protected void dispatchDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.dispatchDraw(canvas);
int count = getChildCount();
int top = count>0 ? getChildAt(0).getTop() : 0;
int backgroundWidth = background.getWidth();
int backgroundHeight = background.getHeight();
int width = getWidth();
int height = getHeight();
int childHeight=getChildAt(0).getHeight()*2;
for (int y = top; y<childHeight; y += backgroundHeight){
for (int x = 0; x<width; x += backgroundWidth){
canvas.drawBitmap(background, x, y, null);
}
}
super.dispatchDraw(canvas);
}