melodiouscode
melodiouscode

Reputation: 2069

Eclipse Android XML jumps around the editor

I have been coping with an annoying "bug" in eclipse (android) for some time, and today it has just annoyed me to much! So I was wondering has anyone else come accross it, and have you found a fix for it?

It's hard to explain, so hopefully these three screen caps will help:

The first screenshot, everything is ok.

Screen 1 - Everything is ok

The second screenshot, after a simple click everything moves around.

Screen 2 - A simple click, notice how lines have duplicated and moved

The third screenshot, another click and things move again.

Screen 3 - Another click, things move again

Closing the file and opening it again seams to solve the problem for a while, but it's really annoying!

Has anyone come across this, or a fix for it?

--EDIT

Forgot to mention, I am running:

Upvotes: 17

Views: 784

Answers (2)

Jimbali
Jimbali

Reputation: 2538

This is a known bug and happens if you edit the layout in the visual editor and then switch back to the xml editor. You can sometimes fix it by scrolling up and down the file or selecting all the text. Otherwise, just close and reopen the xml file when switching from visual editor to xml editor. It's annoying and still happens to me even after several updates to ADT.

Edit:

I have since found a better solution. In Eclipse go to Window->Preferences. Then under Android->Editors uncheck "Automatically format the XML edited by the visual layout editor". This should solve the problem. You can always auto-format the code manually by pressing Ctrl+Shift+F.

Upvotes: 2

melodiouscode
melodiouscode

Reputation: 2069

As some commentators have mentioned it seems that this is a duplicate (have flagged as such), although as it is a hard issue to describe that is no surprise! I have tried an answer from one of the questions and it seems to solve the problem. Although it does not prevent the issue!

Upvotes: 0

Related Questions