android代码格式化方法小结
16lz
2021-12-04
-
Download the android-formatting.xml file
-
Open Eclipse and go to Window->Preferences->Java->Code Style->Formatter
-
Import theandroid-formatting.xmlfile and make sure “Android” is selected in the drop down list
-
In eclipse go to Window->Preferences->General->Editors->Text Editors
-
Check “Insert spaces for tabs” and make sure that “Displayed tab width” is 4
-
Check “Show print margin” and make sure that “Print margin Columns” is 100
-
Check “Show Whitespace characters” (如果不想显示空格的童鞋,可忽略这步)
-
In eclipse go to Window->Preferences->Java->Editor->Save Actions
-
Check “Perform the selected actions on save”
-
Check “Additional Actions” than hit configure
-
Under the “Code Organizing” tab check “Remove trailing whitespace” for all lines and “Correct Indention”
-
Under the “Code Style” tab remove all check marks
-
Under the “Missing Code” tab check everything
-
Now go to Window->Preferences->XML->XML Files->Editor
-
Check “Split multiple attributes each on a new line”
-
Check “indent using spaces” and make sure the value is set to 4
更多相关文章
- Android下如何获取CPU序列号
- android中的汉字转拼音
- 使用命令行创建Android模拟器
- Android特殊字符
- android数字证书-签名(步骤)
- Android(安卓)Studio 使用NDK编译时常见的问题
- Android(安卓)混淆代码有关问题总结
- android studio 插件 - .ignore
- 如何手工创建android项目