Eclipse如何等号对齐?


如题[字数补丁]
补充:
等号对齐示例

java Android eclipse 格式 code

進撃D骑士王 12 years, 1 month ago

我知道有种设置,不过只对一个类里面声明成员变量的那一部分起作用……


 Window > Preferences > Java > Formatter > Edit 那个 profile
然后在Indentaion中选择Spaces only或Tabs only,在Align fileds in columns上打勾
这样在使用Source > Format的时候就会自动对齐。

但是你肯定不会喜欢每次都手动使用Format对不对……


 在之前的Java下面,有一个Editor,选择Save Actions,选上Format source code > Format all lines

这样在保存时就会自动调整格式了。当然以上所有选择都需要选上 Apply ,不过你应该是不会忘了的。

pseudo answered 12 years, 1 month ago

Your Answer