Eclipse格式化设置。。。
来源:互联网 发布:et纸样软件下载 编辑:程序博客网 时间:2024/06/14 08:21
Eclipse 格式化代码块快捷键:Ctrl+Shift+F
但对于XML文件来说有时格式化后,一个控件的配置属性全都挤在一行,阅读和修改起来都很不方便。
而我们希望最佳的格式化效果如下,控件的每个属性配置占一行方便阅读修改,没有子元素的控件直接使用/> 关闭:
<?xml version="1.0"encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/TextView01"
android:text="Some Content"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
1)修改Eclipse的XML格式化配置
勾选 “Split multiple attributeseach on a new line” 即可,如下图所示:
![Eclipse格式化设置。。。 Eclipse格式化设置。。。](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)
2)压缩节点的声明方式
方法为在XML文件内空白地方点击鼠标右键,选择”Source/Cleanup Document...“,如下图所示:
![Eclipse格式化设置。。。 Eclipse格式化设置。。。](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)
之后将弹出如下界面:
![Eclipse格式化设置。。。 Eclipse格式化设置。。。](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)
之后将弹出如下界面:
![Eclipse格式化设置。。。 Eclipse格式化设置。。。](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)
- eclipse代码格式化设置
- Eclipse格式化设置。。。
- Eclipse格式化代码设置
- Eclipse格式化设置
- Eclipse格式化代码设置
- Eclipse代码格式化设置
- Eclipse代码格式化设置
- eclipse设置格式化模板
- 设置eclipse格式化html
- eclipse格式化设置
- eclipse格式化代码设置
- eclipse中设置格式化规范
- eclipse代码格式化风格设置
- Eclipse设置不格式化注释
- Eclipse格式化换行宽度设置
- 自用Eclipse代码格式化设置
- eclipse 代码自动格式化设置
- Eclipse设置不格式化注释
- Android错误:Conversion to Dalvi…
- Android--Gallery实现切一屏
- Android--LayoutInflater用法
- Android-混淆
- Android--PreferenceActivity
- Eclipse格式化设置。。。
- Android--xml实现帧动画
- Android--xml布局文件中使用includ…
- android 自带的主题 theme 的使用
- Android反编译与混淆
- 像素。。。
- Android--Selector、shape详解
- 手机号码归属地查询api接口
- android--点击事件写法