title: Creating a grid of scaled ImageViews [Android]?
body: <p>I need to make a grid whose width and height is the same as the screen. I guess I would somehow use</p>
  
  <pre><code>DisplayMetrics metrics = new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(metrics);
  </code></pre>
  
  <p>to do this but I need to scale the images inside so that each ImageView is 1/10th of the width of the screen (with 10 images for example). Similarly for the image heights.</p>
  
  <p>I have tried</p>
  
  <pre><code>a = (ImageView) findViewById(R.id.imageID);
  a.setMaxHeight(metrics.heightPixels/numberOfImages);
  </code></pre>
  
  <p>But as you can imagine, this is very tedious with 130 images (and not to mention, it doesn't work!) It wouldn't be a problem if I didn't need to cater for lots of screen sizes!</p>
  
  <p>Any help is appreciated! (Bit of an Android noob (-: )</p>