简体   繁体   English

Android Studio创建实时模板

[英]Android studio creating live templates

I am creating a simple live template to show an AlertDialog in AS, snippet: 我正在创建一个简单的实时模板,以在AS中显示AlertDialog,摘要:

在此处输入图片说明

However, the Edit variables option is now inactive, even after I have selected the language type. 但是,即使选择了语言类型,“编辑变量”选项现在也处于非活动状态。 Any help with this? 有什么帮助吗?

Previously I was able to do this 以前我能够做到这一点

A variable in Live templates is specified between '$' characters. Live模板中的变量在“ $”字符之间指定。 I noticed that, in your example, $className is specified instead of $className$ . 我注意到,在您的示例中,指定的是$ className而不是$ className $ Just use the $className$ (ends wit $) instead of $className and the " Edit Variables " button should become active. 只需使用$ className $ (以$结尾)代替$ className ,“ 编辑变量 ”按钮应处于活动状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM