0

I am trying to create a table of images in Android. So i used table layout. The images will be added programmatically.

Now the problem is when the image size varies, the table size also changing, sometimes making the table go beyond the screen.

I need to make the table fit in the screen and the images need to scale automatically to fit in the cell.

Could some one suggest me a solution please?

DPDM
  • 1
  • 2

1 Answers1

0

There is some really nice Android Developer Tutorial on this.

Displaying Bitmaps

Here they're loading bitmaps with an adapter right into a grid layout, you also could do this with a listview etc. works fine. The key thing is to use an AsyncTask for this, so you have no lag on your ui thread.

Look at the given Android Example they have an imageresizer class implemented in their example.

Johannes
  • 21
  • 4