A simple screen of mine contains 3 linearlayouts arranged vertically . To be specific: - the top linearlayout is just a logo bgimage occupying full screen width but short in height, - the middle linear layout has some content (buttons, text etc) and occupies full screen width and a majority of the screen height, - the bottom linearlayout is similar to the topmost and has a logo bgimage occupying full screen width and short in height)
For certain reasons, I want to control the positioning of these layouts in JAVA (and not xml) . The xml simply contains the definition of the above 3 linearlayouts and sets fill_parent and wrap_content as width, height respectively. In the onCreate method of my activity I tried to set the width and height of the three linearlayouts in java. I wanted the topmost and bottom most linearlayout's to occupy 12.5% of the screen height respectively and the middle one to occupy 75% of the screen height; as mentioned above, all 3 occupy full screen width. When I did this using setLayoutParams it DID work but very surprisingly the bottom linear layout was pushed below the visible screen and nearly disappeared. This happened in both the resolutions I checked (392x653 and 320x400). What really puzzled me was that printing out the width and heights of the layouts i.e the 12.5% and 75% of the screen height values in an alert dialog, it was clear that the total height of the 3 layouts added up to to be, on all occasions, LESS than or equal to the screen height in which case how can it be that the bottom most layout was pushed out of the screen vertically and one could barely see it? Any help greatly appreciated, Android_tg -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

