Eclipse xml formatter setting for android

来源:互联网 发布:淘宝装修 学什么代码 编辑:程序博客网 时间:2024/05/09 05:12
Android里使用很多xml 定义layout,我们都习惯在Eclipse里 ctrl + shift + F 格式化代码,对xml文件当然也想这么做。

但默认的效果看着很乱,实际只要改一下Eclipse设置就可以。如下:

菜单Window->preferences->XML->XML Files->Editor
1. 勾上Split multiple atrribute each on a new line
2. 选择Indent using spaces
   Indentation size设为4

author:99fang mobile xjy 

http://www.99fang.com/bj/