广告
返回顶部
首页 > 资讯 > 移动开发 >Android studio | Android APP开发快捷键
  • 331
分享到

Android studio | Android APP开发快捷键

AndroidStudiostudioappAndroid 2022-06-06 13:06:52 331人浏览 八月长安
摘要

这次分享给大家一些Android开发中的快捷键: So Welcome to Android Studio 3.5! 通过阅读这些技巧,您可以


这次分享给大家一些Android开发中的快捷键:
So
Welcome to Android Studio 3.5!
通过阅读这些技巧,您可以快速熟悉IDE的主要功能。

1、Ctrl+N (Navigate | Class)

要在编辑器中快速打开任何类,请按Ctrl+N(Navigate | Class导航类)并开始键入类的名称。从出现的下拉列表中选择类。
在这里插入图片描述
您可以使用Ctrl+Shift+N(导航文件)以类似的方式打开项目中的任何文件

2、Ctrl + 空格

代码完成特性允许您快速完成代码中不同类型的语句。例如,开始键入类名,然后按Ctrl+空格键完成它。当多个选项可用时,它们将显示在查找列表中。(代码补全)
在这里插入图片描述

3、Alt + F7

You can quickly find all places where a particular class, method or variable is used in the whole project by positioning the caret at the symbol’s name or at its usage in code and pressing Alt+F7 (Edit | Find | Find Usages in the popup menu).
通过将插入符号定位在符号的名称或在代码中的用法处,并按Alt+F7(在弹出菜单中编辑“查找”“查找用法”),可以快速查找在整个项目中使用特定类、方法或变量的所有位置。

4、Ctrl + Q

To quickly see the documentation for a class or method at caret, press Ctrl+Q (View | Quick Documentation).
要在插入符号处快速查看类或方法的文档,请按Ctrl+Q(View | Quick documentation)。
在这里插入图片描述

5、Ctrl + B

To navigate to the declaration of a class, method or variable used somewhere in the code, position the caret at the usage and press Ctrl+B (Navigate | Declaration). You can also click the mouse on usages with the Ctrl key pressed to jump to declarations.
要导航到代码中某个地方使用的类、方法或变量的声明,请将插入符号定位在该用法处,然后按Ctrl+B(导航|声明)。您还可以在按住Ctrl键的情况下单击鼠标以跳转到声明。
在这里插入图片描述

6、Ctrl + F12

You can quickly navigate in the currently edited file with Ctrl+F12 (Navigate | File Structure).
It shows the list of members of the current class. Select an element you want to navigate to and press the Enter key or the F4 key.
To easily locate an item in the list, just start typing its name.
您可以使用Ctrl+F12(导航|文件结构)在当前编辑的文件中快速导航。
它显示当前类的成员列表。选择要导航到的元素,然后按回车键或F4键。
要在列表中轻松定位项目,只需键入其名称。

7、shift + F6

You can easily rename your classes, methods and variables with automatic correction of all places where they are used.
To try it, place the caret at the symbol you want to rename, and press Shift+F6 (Refactor | Rename). Type the new name in the popup window that appears, or select one of the suggested names, and press Enter.
通过自动更正类、方法和变量的所有使用位置,您可以轻松地重命名它们。
若要尝试,请将插入符号放在要重命名的符号处,然后按Shift+F6(Refactor | rename)。在出现的弹出窗口中键入新名称,或选择一个建议的名称,然后按回车键。

在这里插入图片描述

8、Ctrl + O / Ctrl + I

You may easily override methods of the base class by pressing Ctrl+O (Code | Override Methods).
To implement methods of the interfaces that the current class implements (or of the abstract base class), use Ctrl+I (Code | Implement methods).
您可以通过按Ctrl+O(Code | override methods)轻松重写基类的方法。
要实现当前类(或抽象基类)实现的接口的方法,请使用Ctrl+I(Code | implement methods)。

9、 Ctrl+Shift+空格

The SmartType code completion greatly helps to find methods and variables that are suitable in the current context, by analyzing the expected type of the whole expression. So doing, Android Studio pinpoints the top five most suitable results and highlights them on the blue background. For example, type
通过分析整个表达式的预期类型,SmartType代码的完成有助于找到适合当前上下文的方法和变量。这样一来,Android Studio就可以精确定位前五个最合适的结果,并在蓝色背景上突出显示出来。例如,键入
在这里插入图片描述

10、Tab / Enter

When using Code Completion, you can accept the currently highlighted selection in the popup list with Tab key.
Unlike accepting with the Enter key, the selected name will overwrite the rest of the name to the right of the caret. This can be especially useful for replacing one method or variable name with another.
使用“代码完成”时,可以使用Tab键接受弹出列表中当前突出显示的选择。
与使用回车键接受不同,所选名称将覆盖插入符号右侧的其余名称。这对于用另一个方法或变量名替换一个方法或变量名特别有用。

11、Alt+Insert (Code | Generate)

Using Alt+Insert (Code | Generate) in the editor, you can easily generate getter and setter methods for any fields of your class.
在编辑器中使用Alt+Insert(Code | Generate),可以轻松地为类的任何字段生成getter和setter方法。
在这里插入图片描述

12、Alt+F1

To quickly select the currently edited element (class, file, method or field) in any view (Project view, Structure view or other), press Alt+F1.
要在任何视图(项目视图、结构视图或其他视图)中快速选择当前编辑的元素(类、文件、方法或字段),请按Alt+F1。
在这里插入图片描述

13、Ctrl+Alt+T (Code | Surround With)

When you want to catch exceptions thrown by some code fragment, select it in the editor, press Ctrl+Alt+T (Code | Surround With) and choose try / catch. The catch blocks for all the exceptions thrown inside the block will be generated automatically.
You can customize the bodies of the generated catch blocks on the Code tab of File | Settings | File and Code Templates.
Use other items in the list to surround with other constructs.
如果要捕获某个代码片段引发的异常,请在编辑器中选择它,按Ctrl+Alt+T(代码|环绕)并选择try/catch。将自动生成在块中引发的所有异常的catch块。
可以在“文件设置”文件和代码模板的“代码”选项卡上自定义生成的捕捉块的主体。
使用列表中的其他项来环绕其他构造。

在这里插入图片描述

14、 new + Ctrl+Shift+空格

在这里插入图片描述


作者:冲动的MJ


--结束END--

本文标题: Android studio | Android APP开发快捷键

本文链接: https://www.lsjlt.com/news/28906.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作