Android: moving buttons freely in Eclipse's graphic layout editor

I have developed several applications for the iPhone, and now I port them to Android.

From what I'm used to, I was able to freely move buttons around using the Interface Editor for iPhone, and from what I understand for Android, you can (or need) use the XML layout file for the “layout”, your buttons and much another.

So that means I have to use tables correctly? Is there a way that I can just freely move the button where I want with the mouse using the graphical layout editor in eclipse?

I have Googled and stumbled upon this WYSIWYG View Editor theme in Android , but I don’t think they came up with a good conclusion ..

Thanks.

-Paul

+7
source share
3 answers

The reason for the absolute layout of the iPhone is that all screens are the same size. Since there are so many different devices for Android, you should try to get used to the relative and linear layout.

To answer no , you cannot place the button in the exact location of the pixel using the graphical layout editor.

+7
source
  • you can (or need) use an XML layout file to “layout” your buttons and more.

Yes, you can use the xml layout. This is not required, however, since you can also create an entire user interface in java.

  • So does this mean that I have to use tables correctly?

No, many layouts are available.

  • Is there a way that I can just freely move the button where I want with the mouse using the graphical layout editor in eclipse?

No, you cannot in Eclipse. You can encode it and see how it changes its location in the layout preview. AbsoluteLayout is deprecated due to issues that it causes with all the different screen sizes.

The best alternative is to master RelativeLayout. This is a very powerful layout that will allow you to position your user interface widgets anywhere on the screen, while at the same time simplifying support for multiple screen sizes.

+6
source

Try clicking the second mouse button on the layout. Change the layout. And then select AbsoluteLayout.

+1
source

All Articles