Linear Layout Issue at Runtime
Posted
by George
on Stack Overflow
See other posts from Stack Overflow
or by George
Published on 2010-05-02T05:40:35Z
Indexed on
2010/05/02
5:47 UTC
Read the original article
Hit count: 358
Hi all,
I am trying to build a layout dynamically which display some text and image for the most part, but has a series of buttons placed next to each other in the bottom.
I have a linear layout that carries the text, another linear layout that carries the image. And yet another linear layout that carries the buttons that get created in a for loop. I have a main layout aligned vertical that adds the text, image and buttons layout, in that order. To finally generate something like this:
Text .... Image ... Button1 Button2 Button3....
The problem is the number of buttons get decided at runtime, so if there are more than 4 buttons, the 5th button gets displayed really tiny. Also, when I tilt the phone, I get only the text and image showing, but no buttons coz the image covers the entire screen.
Layoutting seems to be pretty complicated to me, any help is appreciated!
Thanks George
© Stack Overflow or respective owner