Tal Kanel
Tal Kanel

Reputation: 10785

a bug with eclipse android's graphical layout editor?

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

Upvotes: 4

Views: 1325

Answers (4)

Alex MDC
Alex MDC

Reputation: 2456

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.

Upvotes: 1

SXC
SXC

Reputation: 237

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.

Upvotes: 1

Kalai Selvan.G
Kalai Selvan.G

Reputation: 482

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

Upvotes: 0

Harshal Kshatriya
Harshal Kshatriya

Reputation: 5850

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.

Upvotes: 4

Related Questions