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

前端 未结 3 660
不思量自难忘°
不思量自难忘° 2021-02-13 18:35

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 s

相关标签:
3条回答
  • 2021-02-13 18:48

    I managed to make the code instantly update the graphical layout and to have both of them shown at the same time.

    First, I followed the steps given by louielouie on his answer to have both graphical layout and XML code shown at the same time but this wasn't enough.

    Then, I clicked on the code of the XML file and after that I clicked on the graphical layout. At this point, I was able to make changes on the XML file and they were instantly shown in the graphical layout.

    0 讨论(0)
  • 2021-02-13 18:55

    There is a little bit better possibility to do that then with new editor like louielouie wroted..

    1) Open your layout from project explorer and show it in graphical layout. 2) Get project explorer, right click on your layout 3) Select OPEN WITH -> XML EDITOR 4) At bottom you can switch between Source and Design layout. 5) Catch the 'header' and put it on the side of your graphical layout.

    In short word just right click your layout -> open with -> xml editor.

    0 讨论(0)
  • 2021-02-13 19:00

    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.

    0 讨论(0)
提交回复
热议问题