This is the code that i used :
LinearLayout mLinearLayout;
mLinearLayout = new LinearLayout(this);
ImageView i = new ImageView(this);
i.setImageResource(R.drawable.cow_icon);
i.setAdjustViewBounds(true); // set the ImageView bounds to match
the Drawable's dimensions
i.setLayoutParams(new
Gallery.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
//Add the ImageView to the layout and set the layout as the
content view
mLinearLayout.addView(i);
setContentView(mLinearLayout);
With this code, i can see the image getting didplayed but it goes on a
different layout. It doesnt display on the current layout.
Is there a way i can display this in the current layout ?
On Jul 27, 12:18 pm, Kostya Vasilyev <[email protected]> wrote:
> You could use one image view and several different images with varying
> number of flowers.
>
> Or create the required number of image views from code, all using the same
> image.
>
> Or declare four image views in your layout and manage their visibility from
> code.
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com
>
> 27.07.2010 21:11 пользователь "ethan" <[email protected]> написал:
>
> Ok. So in this case, is there a way to dynamically create imageviews
> from the code (not xml) based on number of images to display ?
> Or should i just statically create 4 imageviews and only populate them
> based on the number of flowers i want to display ?
>
> On Jul 27, 10:52 am, Justin Anderson <[email protected]> wrote:
>
> > No... displaying the number...
> > On Tue, Jul 27, 2010 at 8:25 AM, ethan <[email protected]> wrote:
> > > You are correct.
>
> > > In...
> > > <android-beginners%[email protected]<android-beginners%[email protected]>
>
> <android-beginners%[email protected]<android-beginners%[email protected]>
>
>
>
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/androi...
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en