問題描述
在 Eclipse 中保存 XML 文件時是否可以以某種方式自動格式化?
Is it possible to somehow auto-format when saving XML files in Eclipse?
我知道對于 Java 文件可以這樣做,但我希望它也適用于 XML 文件.
I know it's possible to do it for Java files, but I would like it to happen for XML files as well.
具體來說,我在為 Android 開發(fā)時使用并喜歡 XML 文件的自動格式化功能,因為 Android 非常重視使用 XML 文件.
Specifically, I'm using and loving the auto format feature for XML files while developing for Android, as Android is quite heavy on using XML files.
推薦答案
我將使用我自己的關于即將推出到 ADT 的修復的文章來回答我自己的問題:http://www.androidpolice.com/2010/11/09/for-android-developers-next-version-of-eclipse-adt-to-include-auto-formatting-of-xml/
I'm going to answer my own question using my own article about the fix that's about to be rolled out to ADT: http://www.androidpolice.com/2010/11/09/for-android-developers-next-version-of-eclipse-adt-to-include-auto-formatting-of-xml/
更新:從 r14 開始,ADT 現在終于可以做到這一點了.http://tools.android.com/recent/xmlformatter
Update: since r14, ADT can now finally do this. http://tools.android.com/recent/xmlformatter
這篇關于Eclipse:保存時自動格式化 XML 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!