Search code examples
androideclipseandroid-layoutadt

Eclipse IDE - Android Graphical Layout and XML Layout Side by Side


Is it possible to have the Android Graphical Layout next to the Android XML layout so I can modify both simultaneously? It would be much better to change the XML and instantly see the effects, as opposed to clicking the tab to change it all the time.


Solution

  • Yes, although I just tried it and it has a bit of lag after you change something in the Graphical Layout editor.

    1. Open your layout file, such as "activity_foo.xml".
    2. Choose the menu item "Window > New Editor". This will give you another editor for the same layout. In this example, you'll see two tabs that both have "activity_foo.xml".
    3. Mouse press on the second tab and then drag it to the right and downwards, until you see the outlines of two rectangles representing editor views side by side, then let go of the mouse button.
    4. You now have the editors side by side. Place one into Graphical Layout mode and the other into XML mode by choosing the respective tabs.

    Note that it seems like the Graphical Layout will consistently update the XML. However, changes in the XML don't seem to affect the Graphical Layout until you save and then click in the Graphical Editor again.