4

I'm surely not the first one noticed the problem below:

when using the graphical layout to drug some views into the layout preview, then trying to make some changes directly on the xml file - the lines messing around in strange annoying way. only close and re-open eclipse helps to stop the weird behavior.

someone have a clue how to fix this problem?

is there any plugin prevents it?

TIX

Tal Kanel
  • 10,475
  • 10
  • 60
  • 98

4 Answers4

4

I faced similar problem. I could not find a better solution than this:

  1. Add views using Graphical Layout.
  2. Save the file.
  3. Close it.
  4. Reopen it and then make changes to it.
Harshal Kshatriya
  • 5,630
  • 11
  • 44
  • 60
  • so you saying this problem can't be solve, but I don't have to close eclipse, but only the problematic file? – Tal Kanel Jun 15 '12 at 12:43
  • He's saying that you don't need to close eclipse, only the open file. As for solve the bug, you should file a bug for android eclipse plugin. – Marcio Covre Jun 15 '12 at 12:47
  • @Tal Kanel nininho is right. You have to close the xml file on which you are working. Not the entire eclipse. Then reopen it. – Harshal Kshatriya Jun 15 '12 at 15:38
1

I have experience the same problems. For me, the solution is to change the theme in the layout editor to a default one, such as Holo.light. It solved the problem.

SXC
  • 237
  • 3
  • 8
1

This happens when working on a Windows machine (which uses CRLF for the line endings) as the Android layout editor adds lines with unix-style LF line endings, regardless of the line ending style of the rest of the file. When a file has mixed CRLF and LF endings, the Eclipse text editor gets confused and fails to display it properly.

Workaround: You can convert the line endings of the file to LF before editing it in Eclipse, as this keeps all the line-endings the same and keeps the editor happy. If are insistent on using CRLF line endings (e.g. for source control) then you can convert the file using dos2unix on the command line (or using a nice decent editor like Notepad++), then convert it back to CRLF after making layout changes.

Hopefully the ADT team will fix this bug soon.

Alex MDC
  • 2,416
  • 1
  • 19
  • 17
0

It's Common in Eclipse.

Myself too faced this issue.

No Need to restart the Eclipse,just Close the xml and re-open the same. It works like charm

Kalai Selvan.G
  • 482
  • 3
  • 10
  • 22