提要: 设置Editor>Code Style>Java>Wrapping and Braces>Field annotations
主要内容:
以butterknife为例,为了代码的简洁性,我们通常[我的习惯]希望看到格式化后的代码是这样的:
可是,通常格式化后是这样的:
解决方案:通过AS设置忽略格式化注解,即
Editor>Code Style>Java>Wrapping and Braces>Field annotations 勾选do not wrap
本文介绍如何在Android Studio中通过设置Editor>CodeStyle>Java>WrappingandBraces>Fieldannotations来实现Butterknife字段注解的格式化,避免不必要的换行,使代码更简洁易读。
提要: 设置Editor>Code Style>Java>Wrapping and Braces>Field annotations
主要内容:
以butterknife为例,为了代码的简洁性,我们通常[我的习惯]希望看到格式化后的代码是这样的:
可是,通常格式化后是这样的:
解决方案:通过AS设置忽略格式化注解,即
Editor>Code Style>Java>Wrapping and Braces>Field annotations 勾选do not wrap
1110

被折叠的 条评论
为什么被折叠?