转载请注明本文出自Cym的博客(http://blog.csdn.net/cym492224103),谢谢支持!


About Keymaps

Android Studio provides different keymaps (the mapping between shortcut keys and an action). You can see which keymap you are using inSettings->Keymap.

It wouldn’t be practical to list the shortcuts for every keymap so the following will be used:

  • Windows: Default
  • Linux: Default
  • OSX: Mac OSX 10.5+

Enter vs Tab for Code Completion

Android Studio 使用技巧(5)_第1张图片

There is an interesting difference whether you use code completion with tab or with enter.

Using enter will complete the statement as you would expect. Using tab will complete the statement and delete everything forward until the next dot, parenthese, semicolon or space.

Shortcut (during code completion): enter or tab

Android Studio 使用技巧(5)_第2张图片

If you are in a method that is overriding a parent class (e.g. Activity#onCreate()), this will navigate to the parent implementation.

If you are on the class name, it will navigate to the parent class.

Shortcut :

  • Mac: Cmd+U
  • Windows/Linux: Ctrl+U

Return to the Editor

A bunch of shortcuts will take you away from the editor (type hierarchy, find usages, etc.)

If you want to return to the editor, your options are:

  • Escape: This will simply return the cursor to the editor.
  • Shift+Escape: This will close the current panel and then return your cursor to the editor.

Shortcut :

  • Return and keep panel open: Escape
  • Close panel and Return: Shift+Escape

Jump to Last Tool Window

Android Studio 使用技巧(5)_第3张图片

Sometimes, you return to the editor from a panel but find yourself having to go back to this panel. e.g. browsingfind usages. With this, you can go back to a panel without your mouse.

Shortcut: F12 (might interfere with the OS’s default keybindings)

Hide All Panels

Android Studio 使用技巧(5)_第4张图片

Puts the editor in some sort of full screen mode. Invoking the shortcut a second time returns all panels to their previous state.

Shortcut :

  • Mac: Cmd+Shift+F12
  • windows/linux: Ctrl+Shift+F12

Open a Panel by Its Number

You might have noticed that some of the panels have a number to the left of their name. This is a shortcut to open them!

Just in case you don’t see the panel names, click the box thing in the lower left corner of the IDE.

Shortcut :

  • Mac: Cmd+Number
  • windows/linux: Alt+Number

Parameter Info

Android Studio 使用技巧(5)_第5张图片

This is the same list of parameter names as the one that appears when you are writing a method call. It is useful when you want to see an existing method’s params.

The Parameter under your cursor will be in yellow. If nothing is in yellow, that means that the method call is not valid, probably something that is not casted right (e.g. a float in an int param).

When you are writing a method call and you dismiss it by accident, like I usually do, you can also type a comma (,) to trigger the parameter info.

Shortcut :

  • Mac: Cmd+P
  • windows/linux: Ctrl+P

The Switcher

Android Studio 使用技巧(5)_第6张图片

So this thing is pretty much the alt+tab / cmd+tab of the IDE. It allows you to navigate to a tab or a panel.

Once it is opened, as long as you hold the ctrl key, you can navigate quickly by using the number or letter shortcut. You can also close a tab or a panel by pressing backspace when it is selected.

Shortcut: Ctrl+Tab

Context Info

Android Studio 使用技巧(5)_第7张图片

So this will show you where you are when your scope definition is out of the scrolling area. Usually, this will be the name of the class or inner class but it might also be the current method name.

Its better use, IMO, is to get a quick look at what the current class extends or implements.

It also works in xml files.

Shortcut: Ctrl+Shift+Q


更多相关文章

  1. Android的GridView控件点击图片变暗效果
  2. Android 分别使用Post与Get实现网络图片加载
  3. android 从sdcard 读取图片 剪切 粘贴
  4. Android使用AsyncTask下载图片并显示进度条功能
  5. Android 部分内容设置颜色、字体、超链接、图片
  6. (Android)处理图片成圆形
  7. MixtureTextView 支持Android图文混排、文字环绕图片等效果

随机推荐

  1. [Android] 导入外部数据库
  2. [置顶] Android消息异步机制(ThreadLocal
  3. 浅谈android的selector背景选择器
  4. Android(安卓)Studio 安装具体步骤(配图)
  5. Android(安卓)Studio 创建 aar文件 并 引
  6. Android的四大组件
  7. Android中的Gradle
  8. Android(安卓)ApiDemos示例解析(139):Vie
  9. 利用Android(安卓)Studio、MAT对Android
  10. Android(安卓)动画框架原理