0

I know that similar questions have been asked but I couldn't find a good awnser and I am an android beginner. I want to be able to draw houses (screenshot) during runtime. So far I have bean able to create 400 imageviews with an invisible image in them and at run-time swap the image. I feel like this is extremely inefficient and I seem to have some memory problems. The images do not need to be clickable. I couldn't find a way to add imageviews during runtime. Could I maybe utilize a gridview (seems difficult due to the structure of the board). Thank you

Android app with some houses drawn

4

1 回答 1

0

我更喜欢你使用 AndEngine。你可以在这里( http://www.matim-dev.com/tutorials.html )做一个很好的教程,或者你可以创建你的自定义视图并覆盖 onDraw(Canvas canvas) 方法

@Override
protected void onDraw(Canvas canvas) {

  canvas.drawBitmap(bitmap, left, right,paint);

  super.onDraw(canvas);
}
于 2013-05-02T14:28:07.093 回答