Android Studio annotation template, androidstudio
We can see some project documents and we will find that their annotations are well-formed and well-regulated.
If your code is still annotated with simple // or/**/, you can learn how to set the annotation template in Android Studio.
First, check the following code:
Obviously, this is a standard annotation method. Every parameter of the method is described. Obviously, @ param in this annotation is not artificially typed.
The implementation method is very simple. Enter/** in the previous line of a method and press enter to display the typographical comment. coder only needs to write the parameter meaning after each parameter.
So:
/** @ Author xqx * @ emil djlxqx@163.com * create at #/3/7 * description: Expert profile page */
What about this personalized comment?
It is also very simple. follow the steps below:
1,
2,
3. Click the green plus sign in the upper right corner.
4. Get a name
5. In the newly created template Group
6. Edit the comment Template
7. Click
Set Dynamic Time
8. Click the setting comment below to see if the setting comment takes effect.
9. confirm completion
Check whether the test is successful. Enter the defined name in the Code. The system will prompt you to press Enter.
We add comments on our own initiative.
What if there is a default comment after a new class is created?
Simple: