You should be able to do this as follows:
setMinimumWidth(w);
setMaxWidth(w);
setMinimumHeight(h);
setMaxHeight(h);

Or, if you set it up as a horizontal linear layout that contains the four
different views and give each view the same weight (e.g. give each ImageView
a weight value of 1), then the layout should be able to do the resizing work
for you and make sure that each view takes up the same amount of space on
the screen, regardless of the screen size or resolution.

Personally, I think that creating layouts in android with XML files is
genius.  It takes some getting used to, but once you get the hang of it, it
is very handy.

Thanks,
----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Fri, Sep 11, 2009 at 8:33 PM, BGH <bradleygh...@gmail.com> wrote:

>
> I have to say creating layouts in Android would have to be the most
> frustrating experience in all my years of programming. I dread it
> every time I create a new Android app.
>
> I simply want to have four images laid out horizontally across the
> screen. All four images are the same size and have the same width +
> height. The images are quite large because I want them to still look
> good if they are used on an Android device with a high res.
>
> It would be fine if I could just set the size of the imageview in the
> XML but because it is never known how big the screen res will be I
> cant really hard code a value in if I always want the four pics to be
> sized evenly across the screen.
>
> So is the approach to just create four imageviews in something like a
> horizontal linear layout and then changing the size of the imageview
> in the code? If so I cant seem to find anywhere how to change the size
> of an imageview dynamically?
>
> Am I better off physically creating the imageviews at runtime so I can
> set the size to be 1/4 the screen size?
>
> Any help would be greatly appreciated.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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