Problems with Android XML Editor and Eclipse…Hard to manually edit XML

前端 未结 8 1449
被撕碎了的回忆
被撕碎了的回忆 2021-01-17 12:45

It\'s been a few years since I have last developed android apps. Since then, a graphical editor was added to Eclipse that allows you to generate the XML for an layout in a

相关标签:
8条回答
  • 2021-01-17 13:25

    I can also confirm this behavior, though I didn't recall having this problem on earlier version of Eclipse so I strongly suspect it's the 4.x version of eclipse that's interfering with the xml editor, I use even newer 4.2+

    edit: you may want to track this issue http://code.google.com/p/android/issues/detail?id=27155

    0 讨论(0)
  • 2021-01-17 13:25

    In word, Tools - options - Edit tab, be sure the typing replaces selection is checked. Spacebar key will then work to delete text.

    0 讨论(0)
  • 2021-01-17 13:26

    Although this is not exactly a solution (and hopefully doesn't earn me some downvotes) I've found a nice compromise is to open the layout twice, once in the android layout editor and once in the normal XML editor.

    You can do this by right clicking the file (or alt clicking on mac I assume) and selecting "Open With", you should see all the different android editors, a text editor and an XML editor.

    The nice thing about opening it twice is you can have it side-by-side (drag it to another pane), the only issue now is that you have to give focus to the android layout editor in order for it to update, but at least you have your shortcuts and delete keys.

    0 讨论(0)
  • 2021-01-17 13:29

    This is fixed in ADT 20 Preview 3, released today.

    http://tools.android.com/download/adt-20-preview

    0 讨论(0)
  • 2021-01-17 13:35

    I have the same issues, delete, ctrl-v not working in the latest Eclipse as of July 2012 with the latest Android plugin on Linux Mint 64 bit. It's definiteley (in my case at least) the android XML editor that is at fault. As Damon says, opening the xml using eclipse with "open with" and not choosing the android editor fixes the issue. The android editor can be open in parallel.

    0 讨论(0)
  • 2021-01-17 13:40

    You can manually define commands and shortcut keys through Windows > Preferences > General > Keys

    I actually copied "Ctrl + C", "Ctrl + V", "Ctrl + Y", "Ctrl + Z" commands and define the "When"s as "Editing XML source".

    It works!

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