[英]How set prefix (e.g. “m”) to remove in Android Studio's Alt-Insert getter/setter?
I make most of my member variables start with the letter "m", for example mId
or mIsSomething
. 我将大多数成员变量以字母“ m”开头,例如
mId
或mIsSomething
。 When I use the keyboard shortcut to add getters/setters, I end up with: 当我使用键盘快捷键添加getter / setter时,最终得到:
public void setmId() {}
but I want: 但我想要:
public void getId() {}
How do I set a prefix for it to remove when creating the getter/setter? 创建getter / setter时如何设置要删除的前缀?
I found the solution: 我找到了解决方案:
Go to File -> Other Settings -> Default Settings
转到
File -> Other Settings -> Default Settings
In the search box, type "prefix". 在搜索框中,键入“前缀”。
On the right, select the tab "Code Generation". 在右侧,选择选项卡“代码生成”。
In the "prefix" box, type m
(or whatever your prefix is) 在“前缀”框中,键入
m
(或任何前缀)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.