与Android布局的main.xml中的Eclipse? [英] Eclipse with Android layout's main.xml?

查看:150
本文介绍了与Android布局的main.xml中的Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/10030727/moving-and-vanishing-lines-of-$c$c-trouble-with-eclipses-xml-editor">Moving和消失的code线;与Eclipse的XML编辑器麻烦

Possible Duplicate:
Moving and vanishing lines of code; trouble with Eclipse's XML Editor

我注意到了这个奇怪的问题与Eclipse每当我尝试编辑布局。它甚至不是与编辑的问题。这是当我点击的main.xml文件中的问题,这就是正确的,点击。它会自动复制我行信息,将其推到下一个线和螺丝整个文件了。 Eclipse的正常工作与我的所有其他文件,如在Android中string.xml和Java文件。有人可以帮助我在这里?

I noticed this weird problem with Eclipse whenever i try to edit the layout. It's not even the problem with editing. It's the problem when i click in the main.xml file, thats right, CLICKING. It automatically duplicate my line information, push it down to the next line and screws the whole file up. Eclipse works fine with all my other files like string.xml and java files in Android. Can someone help me out here?

推荐答案

一些测试后,我发现,选择自动格式化的可视化布局编辑器编辑XML(以preferences |安卓|编辑)可能是罪魁祸首这里。

After some tests, I have found that the option "Automatically format the XML edited by the visual layout editor" (in Preferences | Android | Editors) might be the culprit here.

通过我的测试中,我发现更改属性(如layout_gravity),而在图形布局设计模式总是搞砸了文件的直观显示,当我回到XML(文本)模式时,此选项为ON,但我有没有问题时,它的关闭。

With my tests, I've found that changing a property (such as the layout_gravity) while in Graphical Layout design mode always screw up the visual display of the file when I go back to the XML (text) mode when this option is ON but that I have no problem when it's off.

。另外,我没有看到任何问题,使用选项格式保存时;甚至当我在图形布局模式下使用它;所以你可以使用Ctrl-S,而不是当你仍然在图形布局模式,既节约和格式化XML。

If you want to format the XML upon your return from the Graphical Layout design mode, simply use the shortcut Ctrl-Shift-F. Also, I didn't see any problem with using the option "Format on Save"; even when I use it in the Graphical Layout mode; so you can use Ctrl-S instead while you're still in the Graphical Layout mode to both save and format your XML.

我已经尝试过其他编辑器,如显示量程指示或使用字符显示变化的垂直标尺的选择,但我没有看到任何行为上的差异与激活或去激活这些选项。

I've tried other editors options like "Show range indicator" or "Use characters to show changes in vertical ruler" but I didn't see any difference in behavior with activating or de-activating these options.

最后,以纠正该文件的视觉显示时,它的损坏;我发现,使用快捷键:Ctrl-A,按Ctrl-C,CTRL-V是不是关闭/重新打开该文件更容易一点。这相当于使A全选,复制,粘贴;有效地复制整个XML文件并覆盖其自身。

Finally, to correct the visual display of the file when it's corrupt; I found that using the shortcut: Ctrl-A, Ctrl-C, Ctrl-V is a little easier than closing/reopening the file. This is equivalent to making a Select All, Copy, Paste; effectively copying the whole XML file over itself.

这篇关于与Android布局的main.xml中的Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆