I've developed several iPhone apps and now I'm porting them onto Android.
From what I was used to, I was able to freely move buttons around using the Interface Editor for the iPhone, and from what I understand for Android, you can (or need) to use the XML layout file to "layout" your buttons and whatnot.
So this means I have to use tables right? Is there a way that I can just freely move a button where I want with my mouse using the graphical layout editor in eclipse?
I've Googled and came upon this thread WYSIWYG View Editor in 'Android'? but I don't think they came up with a good conclusion..
Thanks.
-Paul
The reason for iPhone absolute layouts is that all the screens are the same size. Because there is such a wide variety of android devices, you should try getting used to relative and linear layout construction.
To answer, no, you won't be able to place a button in an exact pixel location using the graphical layout editor.
Yes, you can use an xml layout. It's not required, though, as you can also create the whole UI in java.
No, there are many layouts available to choose from.
No, you can't in Eclipse. You can code it and see how it changes it's location in the layout preview. The AbsoluteLayout is deprecated due to the problems it causes with all the different screen sizes around.
The best alternative option is to master the RelativeLayout. It is a very powerful layout that will let you position your UI widgets anywhere in the screen while at the same time makes it easy to support multiple screen sizes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With