当我在 Eclipse 中编写 .xml 文件时,我经常不得不手动缩进代码.例如
When I write .xml files in Eclipse, I often have to manually indent code. For example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
格式化后是这个样子.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
如何自动化?我在 Eclipse 中找不到 XML 格式设置.
How to automate this? I can't find formatting settings in Eclipse for XML.
Ctrl+Shift+F
会为你做的,你可以在里面配置
Will do it for you, and you can configure it in
Window -> Preferences -> XML -> Xml Files -> Editor
这篇关于在 Eclipse 中格式化 XML 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何在 android eclipse 中制作水平滑动日历?How can I make a horizontal sliding calendar in android eclipse?(如何在 android eclipse 中制作水平滑动日历?)
如何将 SimpleDateFormat 与日历一起使用?How can I utilize SimpleDateFormat with Calendar?(如何将 SimpleDateFormat 与日历一起使用?)
在 XMLGregorianCalendar 中指定日期格式Specify the date format in XMLGregorianCalendar(在 XMLGregorianCalendar 中指定日期格式)
Eclipse CDT 没有在头文件更改时构建项目Eclipse CDT not building project on header file change(Eclipse CDT 没有在头文件更改时构建项目)
Eclipse C++ 包括来自我的源文件夹的头文件Eclipse C++ including header file from my source folder(Eclipse C++ 包括来自我的源文件夹的头文件)
Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件Eclipse C/C++ (CDT) import files into project - header file not found - include path(Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件 - 包