title: Android add imageview programmatically fix size all screen
body: <p>I'm creating several ImageViews programmatically, but I'm running into an issue where there are different ImageView sizes on different displays.
  I want the ImageView size to be fixed on all screens. Here is how I am generating those ImageViews:</p>
  
  <pre><code>for (int i = 0; i &lt; myImageList.size(); i++) {
      ImageView iv = new ImageView(this);
      iv.setImageResource(myImageList.get(i));
      FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(420, 210);
      lp.gravity = Gravity.CENTER;
      iv.setLayoutParams(lp);
      float angleDeg = i * 360.0f / myImageList.size() - 70.0f;
      float angleRad = (float) (angleDeg * Math.PI / 180.0f);
      iv.setTranslationX(320 * (float) Math.cos(angleRad));
      iv.setTranslationY(320 * (float) Math.sin(angleRad));
      iv.setRotation(angleDeg + 80.0f);
      main.addView(iv);
      final int finalI = i;
  }
  </code></pre>