Android Studio 快捷方式,如 Eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27657025/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:28:28  来源:igfitidea点击:

Android Studio shortcuts like Eclipse

eclipseandroid-studio

提问by android learner

I am new to Android Studio and want to know about shortcuts. In Eclipse we use shift-ctrl-Ofor importing. In Android Studio we use alt-enter. My question about importing override methods and unimplemented methods. Is there a shortcut for these in Android Studio?

我是 Android Studio 的新手,想了解快捷方式。在 Eclipse 中,我们shift-ctrl-O用于导入。在 Android Studio 中,我们使用 alt-enter. 我关于导入覆盖方法和未实现方法的问题。Android Studio 中有这些快捷方式吗?

回答by Android Boy

You can use Eclipse Short-cut key in Android Studio too.

您也可以在 Android Studio 中使用 Eclipse 快捷键。

File -> Settings -> Keymap -> <Choose Eclipse from Keymaps dropdown> 

For Mac OS :

对于 Mac 操作系统:

File -> Preferences or Properties -> Keymap -> <Choose Eclipse from Keymaps dropdown> 

回答by Subhalaxmi

Yes, the list of keyboard shortcuts for Android Studio is at https://developer.android.com/studio/intro/keyboard-shortcuts.html.

是的,Android Studio 的键盘快捷键列表位于https://developer.android.com/studio/intro/keyboard-shortcuts.html

Here are a few that I know.

以下是我所知道的一些。

Check :File ->Settings ->Keymap -> <Choose Eclipse from Keymaps dropdown> or

检查:文件 -> 设置 -> 键盘映射 -> <从键盘映射下拉列表中选择 Eclipse> 或

Add unimplemented methods:CTRL+ I

添加未实现的方法:CTRL+I

Override methods:CTRL+ O

覆盖方法:CTRL+O

Format code:CTRL+ ALT+ L

格式代码:CTRL+ ALT+L

Show project:ALT+ 1

展示项目:ALT+1

Show logcat:ALT+ 6

显示 logcat:ALT+6

Hide project - logcat:SHIFT+ ESC

隐藏项目 - logcat:SHIFT+ESC

Build:CTRL+ F9

构建:CTRL+F9

Build and Run:CTRL+ F10

构建和运行:CTRL+F10

Expand all:CTRL+ SHIFT+ NumPad +

展开全部:CTRL+ SHIFT+NumPad +

Collapse all:CTRL+ SHIFT+ NumPad -

全部折叠:CTRL+ SHIFT+NumPad -

Find and replace:CTRL+ R

查找和替换:CTRL+R

Find:CTRL+ F

查找:CTRL+F

In case I'm missing any shortcut that you need you can ask here and for more check implink!!or link!!:)

如果我遗漏了您需要的任何快捷方式,您可以在这里询问并查看更多信息!!链接!!:)

回答by Jorge Casariego

If you use Android Studiowith Mac OS Xthese are some shortcuts:

如果您在Mac OS X 上使用Android Studio,这些是一些快捷方式:

- Compile java sourcesSHF+CMD+F9

-编译Java源SHF+ CMD+F9

- Build the projectCMD+F9

- 构建项目CMD+F9

- Run the current configurationCTR+R

- 运行当前配置CTR+R

- Run in debuggerCTR+D

- 在调试器中运行CTR+D

- Open project propertiesCMD++;

- 打开项目属性CMD+ +;

- Open Android Studio preferencesCMD++,

- 打开 Android Studio 首选项CMD+ +,

- Find any commandSHF+CMD+A

- 查找任何命令SHF+ CMD+A

- Auto-format codeOPT+CMD+L

- 自动格式化代码OPT+ CMD+L

- Delete lineCMD+DELETEor CMD+Backspace

- 删除行CMD+DELETECMD+Backspace

- Duplicate line/selectionCMD+D

- 重复行/选择CMD+D

- Copy lineCMD+C(with nothing selected)

- 复制行CMD+ C(不选择任何内容)

- Select next occurance(s)CTR+G

- 选择下一次出现CTR+G

Scope based selection

基于范围的选择

  • Select next higher scope Option+UP

  • Select next lower scope Option+DOWN

  • 选择下一个更高的范围Option+UP

  • 选择下一个较低的范围Option+DOWN

enter image description here

在此处输入图片说明

Navigating the code

导航代码

- Open classCMD+O

- 公开课CMD+O

- Open fileSHF+CMD+O

- 打开文件SHF+ CMD+O

- Navigate back to last positionCMD+[

- 导航回上一个位置CMD+[

- Navigate forward to previous positionCMD+]

- 向前导航到上一个位置CMD+]

- Switch to recently used filesCRT+TAB

- 切换到最近使用的文件CRT+TAB

Intention Actions

意图行动

  • If/Switch actions Option+RETURN
  • If/Switch 动作Option+RETURN

enter image description here

在此处输入图片说明

Create methodCMD+N

创建方法CMD+N

or

或者

enter image description here

在此处输入图片说明

Loop an array of ints

循环一个整数数组

enter image description here

在此处输入图片说明

  • Generate Logs usin logd, loge, logi, logt, logmand logr
  • 生成日志全光照logdlogelogilogtlogmlogr

enter image description here

在此处输入图片说明

- Project quick fixALT+ENTER

- 项目快速修复ALT+ENTER

- Show docs for selected APIF1

- 显示所选 API 的文档F1

- Jump to sourceCMD+down-arrow

- 跳转到源CMD+down-arrow

Most of them I found on this really good articleand Android Studio Tips and Tricks

我在这篇非常好的文章Android Studio Tips and Tricks 中找到了其中的大多数

回答by Manish Rajpurohit

Yes you can go to File -> Settings -> Editor -> Auto Import -> Java and make thefollowing changes:

是的,您可以转到File -> Settings -> Editor -> Auto Import -> Java 并进行以下更改:

1.change Insert imports on paste value to Allin drop down option.

1.将在粘贴值上插入导入更改为全部下拉选项。

2.markAdd unambigious imports on the fly option as checked.(For Window or linux user)

2.markAdd unambigious import on the fly 选项为选中。(对于Window或linux用户)

On a Mac, do the same thing in Android Studio -> Preferences

在 Mac 上,在 Android Studio -> Preferences 中做同样的事情

3.You can also use Eclipse shortcut key in Android Studio just go to in Android Studio

3.你也可以在Android Studio中使用Eclipse快捷键,直接进入Android Studio

File -> Settings -> KeyMap -> Keymaps dropdown Option. Select from them

文件 -> 设置 -> KeyMap -> Keymaps 下拉选项。从他们中选择

Thankyou

谢谢

回答by Rohit Suthar

Important Android Studio Shortcuts You Need the Most

您最需要的重要 Android Studio 快捷方式



Navigation Shortcuts

导航快捷方式

  • Go to class : CTRL+ N

  • Go to file : CTRL+ SHIFT+ N

  • Navigate open tabs : ALT+ Left-Arrow; ALT+ Right-Arrow

  • Lookup recent files : CTRL+ E

  • Go to line : CTRL+ G

  • Navigate to last edit location : CTRL+ SHIFT+ BACKSPACE

  • Go to declaration : CTRL+ B

  • Go to implementation : CTRL+ ALT+ B

  • Go to source : F4

  • Go to super Class : CTRL+ U

  • Show Call hierarchy : CTRL+ ALT+ H

  • Search in path/project : CTRL+ SHIFT+ F

  • 去上课: CTRL+N

  • 转到文件: CTRL+ SHIFT+N

  • 导航打开的标签: ALT+ Left-Arrow; ALT+Right-Arrow

  • 查找最近的文件: CTRL+E

  • 转到行: CTRL+G

  • 导航到最后编辑的位置: CTRL+ SHIFT+BACKSPACE

  • 转到声明: CTRL+B

  • 去实现: CTRL+ ALT+B

  • 转到来源: F4

  • 去超级班: CTRL+U

  • 查看调用层次结构: CTRL+ ALT+H

  • 搜索路径/项目: CTRL+ SHIFT+F



Programming Shortcuts

编程快捷键

  • Reformat code : CTRL+ ALT+ L

  • Optimize imports : CTRL+ ALT+ O

  • Code Completion : CTRL+ SPACE

  • Issue quick fix : ALT+ ENTER

  • Surround code block : CTRL+ ALT+ T

  • Rename and refactor : SHIFT+ F6

  • Line Comment or Uncomment : CTRL+ /

  • Block Comment or Uncomment : CTRL+ SHIFT+ /

  • Go to previous/next method : ALT+ UP/DOWN

  • Show parameters for method : CTRL+ P

  • Quick documentation lookup : CTRL+ Q

  • 格式化代码: CTRL+ ALT+L

  • 优化进口: CTRL+ ALT+O

  • 代码完成: CTRL+SPACE

  • 问题快速修复: ALT+ENTER

  • 环绕代码块: CTRL+ ALT+T

  • 重命名和重构: SHIFT+F6

  • 行注释或取消注释: CTRL+/

  • 块注释或取消注释: CTRL+ SHIFT+/

  • 转到上一个/下一个方法: ALT+UP/DOWN

  • 显示方法参数: CTRL+P

  • 快速文档查找: CTRL+Q



General Shortcuts

一般快捷方式

  • Delete line : CTRL+ Y

  • Safe Delete : ALT+ DELETE

  • Close Active Tab : CTRL+ F4

  • Build and run : SHIFT+ F10

  • Build : CTRL+ F9

  • All purpose (Meta)Shortcut : CTRL+ SHIFT+ A

  • 删除行: CTRL+Y

  • 安全删除: ALT+DELETE

  • 关闭活动标签: CTRL+F4

  • 构建并运行: SHIFT+F10

  • 构建: CTRL+F9

  • 所有目的(元)快捷键: CTRL+ SHIFT+A

回答by Shanki Bansal

Another option is :

另一种选择是:

View  >  Quick Switch Scheme  >  Keymap  >  Eclipse

回答by anand krish

Android Studio is built on IntelliJ IDEA Community Edition, the popular Java IDE by JetBrains. This allows the user to select their own keymap (supporting different IDE shortcuts in your IDE).

Android Studio 基于 IntelliJ IDEA 社区版构建,这是 JetBrains 流行的 Java IDE。这允许用户选择自己的键盘映射(在您的 IDE 中支持不同的 IDE 快捷方式)。

You can use "Mac os X, Visual studio, Eclipse, Netbeans etc.. shortcuts in your Android Studio by doing the following:

您可以通过执行以下操作在 Android Studio 中使用“Mac os X、Visual Studio、Eclipse、Netbeans 等”快捷方式:

File-> Settings-> Keymap-> choose "Eclipse" from dropdown.

File-> Settings-> Keymap->Eclipse从下拉菜单中选择“ ”。

ORpress Ctrl+Alt+S-> keymap-> choose "Eclipse" from dropdown like this.

或者Ctrl+ Alt+ S-> keymap->Eclipse像这样从下拉列表中选择“ ”。

enter image description here

在此处输入图片说明

回答by Android is everything for me

View > Quick Switch Scheme > Keymap > Eclipse
use this option for eclipse keymap or if u want to go with AndroidStudio keymap then follow below link

视图 > 快速切换方案 > 键盘映射 > Eclipse
将此选项用于 Eclipse 键盘映射,或者如果您想使用 AndroidStudio 键盘映射,请按照以下链接操作

Click here for Official Android Studio Keymap Refference guide

单击此处获取官方 Android Studio Keymap 参考指南

you may find default keymap referrence in

您可能会在其中找到默认的键盘映射参考

AndroidStudio --> Help-->Default keymap refrence

AndroidStudio --> 帮助--> 默认键盘映射参考

回答by Sanjay Hirani

You can change your keymap to use eclipse shortcuts. You can see here how to change keymap. https://stackoverflow.com/a/25419358

您可以更改键盘映射以使用 eclipse 快捷方式。您可以在此处查看如何更改键盘映射。https://stackoverflow.com/a/25419358

回答by srv_sud

These are some of the useful shortcuts for Android studio (Windows)

这些是 Android Studio ( Windows) 的一些有用的快捷方式

  • Double Shift- Search EveryWhere

  • Ctrl+ Shift+A- quick command search

  • Ctrl+N- Find Class (capable of finding internall classes aswell)

  • Ctrl+Shift+N- Find File

  • Alt+F7 - Find Uses (To get the call hierarchy)

  • Ctrl+B- goto class definition.

  • Ctrl+LeftClick - goto to symbol(variable, method, class) definition/definition.

  • Ctrl+Alt+Left- Back

  • Ctrl+Alt+Right - Right

  • Shift+f6 - Refactor/Rename

  • Double Shift- 到处搜索

  • Ctrl+ Shift+ A- 快速命令搜索

  • Ctrl+ N- 查找类(也能够查找内部类)

  • Ctrl+ Shift+ N- 查找文件

  • Alt+ F7 - 查找用途(获取调用层次结构)

  • Ctrl+ B- 转到类定义。

  • Ctrl+ LeftClick - 转到符号(变量、方法、类)定义/定义。

  • Ctrl+ Alt+ Left- 返回

  • Ctrl+ Alt+ Right - 右

  • Shift+ f6 - 重构/重命名