1. Download the android-formatting.xml file

  2. Open Eclipse and go to Window->Preferences->Java->Code Style->Formatter

  3. Import theandroid-formatting.xmlfile and make sure “Android” is selected in the drop down list

  4. In eclipse go to Window->Preferences->General->Editors->Text Editors

  5. Check “Insert spaces for tabs” and make sure that “Displayed tab width” is 4

  6. Check “Show print margin” and make sure that “Print margin Columns” is 100

  7. Check “Show Whitespace characters” (如果不想显示空格的童鞋,可忽略这步)

  8. In eclipse go to Window->Preferences->Java->Editor->Save Actions

  9. Check “Perform the selected actions on save”

  10. Check “Additional Actions” than hit configure

  11. Under the “Code Organizing” tab check “Remove trailing whitespace” for all lines and “Correct Indention”

  12. Under the “Code Style” tab remove all check marks

  13. Under the “Missing Code” tab check everything

  14. Now go to Window->Preferences->XML->XML Files->Editor

  15. Check “Split multiple attributes each on a new line”

  16. Check “indent using spaces” and make sure the value is set to 4


更多相关文章

  1. Ubuntu 下创建启动器
  2. Android(安卓)SystemClock
  3. Android:保护自己开发的Android应用程序
  4. Android(安卓)little error records
  5. Android(安卓)GUI Padding和斜体字的问题
  6. Android(安卓)Studio:一个空格导致的错误
  7. android隐藏EditText光标
  8. android 控件属性 116
  9. 【前端】手机号码输入框添加 空格

随机推荐

  1. android通过服务实现消息推送
  2. 一个同步工具类CyclicBarrier的详解(干货
  3. java中一个重要的原子类AtomicInteger详
  4. Docker Swarm 下搭建 MongoDB 分片+副本+
  5. 微服务初级设计指南
  6. 基于角色的访问控制
  7. java并发编程CAS机制原理分析
  8. HTTPS 项目实战指南
  9. 基于数据的访问控制
  10. android通过Location API显示地址信息的