Hey all,

I'm trying to add ImageView's dynamically, and I want them to be
placed next to each other.  Everything I try just puts them on top of
each other:

      for (int i=0; i < num_photos; i++) {

            ImageView iv = new ImageView(this);
            iv.setLayoutParams(new LayoutParams(45, 45));
            iv.setAdjustViewBounds(true);
            iv.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
            iv.setPadding(0, 0, 0, 0);


            RelativeLayout rl = (RelativeLayout) findViewById
(R.id.rl);

           //I've tried:
            rl.addView(iv);

           //I've tried:
            rl.addView(iv, 2);

           //I've tried:
            rl.addView(iv, new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));

        }


Any ideas?  Thanks in advance...

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to