`

live Template

 
阅读更多

       这是android studio提供的另一种方便开发的使用工具,打开方式为》setting>Editor》Live Template.

       比如展开Android:

 

        可以看到其中有fbc(findviewbyid with cast),这就表示,只需要在代码编辑界面输入fbc,然后回车就可以直接出现:

() findViewById(R.id.);

       还有输入Toast,然后选择Create a new toast就可以直接显示出来

 Toast.makeText(MainActivity.this, "", Toast.LENGTH_SHORT).show();

 甚至context参数都自动填写好了,可比一般的代码自动补全方便多了,还有很多例子,可以慢慢掌握
 

      

  • 大小: 27.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics