Android Studio: how to remove/update the “Created by” comment added to all new classes?

本文介绍如何在Android Studio中定制或移除默认添加到新类中的头部注释。通过设置面板中的“File and Code Templates”选项,可以编辑或更改这些注释模板。

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?

share improve this question
 

3 Answers

up vote 85down voteaccepted

From the menu bar:

  • on Macs choose Android Studio -> Preferences
  • on Windows choose File -> Settings

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

You have two ways you can change this...

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

enter image description here

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

templates tab edit

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

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

These instructions are based on Android Studio v0.3.7.

转载于:https://www.cnblogs.com/popeylj/p/4667609.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值