views:

93

answers:

1

Hello all,

First of all I'm a newbie when it comes to Android programming. So if this question is totally stupid please delete it ASAP :-).

Question:

I'm going to draw a grid of 10x10 PNG images. Each image is 32x32 px. All of the images are unique. I'm thinking that the easiest way seems to be to put each image in an ImageView.

If adding all ImageView's to the layout would this give me some kind of performance hit?

Would there be any smarter way to draw these images?

Thanks.

/ Henrik

+2  A: 

I assume that your grid is a gridview. Than it should have an adapter with your items. There is a getView method in the adapter you need to take look into. You set your images there. I would look at GridView examples and this example

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html

to take a look how to write efficient adapters.

Alex Volovoy