Android Studio:如何删除/更新“创建者"评论添加到所有新课程? [英] Android Studio: how to remove/update the "Created by" comment added to all new classes?

查看:31
本文介绍了Android Studio:如何删除/更新“创建者"评论添加到所有新课程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Android Studio 会自动为所有新类添加标题注释,例如

By default Android Studio automatically adds a header comment to all new classes, e.g.

/**
 * Created by Dan on 11/20/13.
 */

自定义或删除它的设置在哪里?

Where is the setting to customize or remove it?

推荐答案

从菜单栏:

  • 在 Mac OS 上选择 Android Studio -> Preferences
  • 在 Windows 和 Linux 上选择 File -> Settings
  • on Mac OS choose Android Studio -> Preferences
  • on Windows and Linux choose File -> Settings

然后在左侧窗格中查找 Editor -> File and Code Templates.

Then look for Editor -> File and Code Templates in the left hand pane.

你有两种方法可以改变这个...

You have two ways you can change this...

1) 选择Includes 标签并直接编辑Created by... 文本.

1) Select the Includes tab and edit the Created by... text directly.

2) 选择 Templates 选项卡并编辑您想要的任何模板的 #parse("File Header.java") 行.

2) Select the Templates tab and edit the #parse("File Header.java") line for any template that you desire.

我个人遵循选项 1) 并将默认标题注释设为 TODO,例如

Personally I followed option 1) and made the default header comment a TODO, e.g.

/**
 * TODO: Add a class header comment!
 */

这些说明基于 Android Studio v0.3.7.并在 v1.2.1.1 上测试

These instructions are based on Android Studio v0.3.7. and also tested on v1.2.1.1

这篇关于Android Studio:如何删除/更新“创建者"评论添加到所有新课程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆