问题描述
我制作了一个模板来为我的结构化项目节省时间.
I made a template to save time for my structured projects.
这是一个基本模板,所以我只在创建新项目时使用它,但是当我想创建新对象(Xml、类、活动、片段等)时,Android Studio 也会显示我的模板.
It's a base template so I only use it when I create a new project, but Android Studio shows my template also when I want to create a new object (Xml, class, activity, fragment, etc).
当我想创建一个新项目时,我只想显示我的模板作为一个选项.我试图找到一些东西来改变它,但我没有得到任何有用的东西.
I want to only show my template as an option when I want to create a new project. I tried to find something to change it, but I didn't get anything useful.
推荐答案
只需转到 \plugins\android\lib\templates\activities
并查看那里定义的模板.
Just go to <android studio directory>\plugins\android\lib\templates\activities
and look to templates defined there.
我做了同样的事情.我没有找到如何为新项目创建模板,所以我刚刚为新模块创建了一个模板.
I done same thing. I didn't found how to create a template for new project, so i have just created a template for new module.
推荐阅读是:
- http://www.i-programmer.info/professional-programmer/resources-and-tools/6845-android-adt-template-format-document.html
- http://www.i-programmer.info/projects/215-mobile/6843-custom-projects-in-android-studio.html
- http://robusttechhouse.com/tutorial-how-to-create-custom-android-code-templates/
- https://coderwall.com/p/fsxvyw/file-android-studio 中的模板
这篇关于Android Studio 自定义模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!