How to change object positions in an android layout?
Posted
by Pedro Santos
on Stack Overflow
See other posts from Stack Overflow
or by Pedro Santos
Published on 2010-06-07T10:45:05Z
Indexed on
2010/06/07
10:52 UTC
Read the original article
Hit count: 258
Hi,
I'm currently working on a very simple aplication, and I intended to make it change the visual aspect depending on the screen size. The application just has 6 buttons like this:
http://www.freeimagehosting.net/uploads/e1efb4c4d0.jpg
I'm using the AbsoluteLayout, and changing the x and y of the buttons with the methods offsetLeftAndRight and offsetTopAndBottom. I'm not changing the layout of the buttons in the xml file, so the all start in the same place.
However, if I use this methods inside the onClickMethod they sometimes appear where I want them, sometimes don't (can't figure out why), but if i use them in the onCreate method, nothing happens.
Can someone point me in the right direction?
Thanks
© Stack Overflow or respective owner