您的位置:首页 > 移动开发 > Android开发

Android Studio Tips & Tricks: Moving Around

2015-09-16 11:53 399 查看
Opening ClassFileSymbol
打开新类Ctrln

Open Filectrlshiftn

Open Symbolctrlaltshiftn

部分匹配Partial Matching

Line Number

recent file
Recently opened filesctrle

Recently edited filesctrlshifte

Navigate BackForwardctrlaltleftright

Last Edit Locationctrlshiftbackspace

Show Usage
In a Persistent Panelaltf7

In Placectrlaltf7

Goto DeclarationImplementation Drill Down
Goto Declaration去定义声明的地方

Goto Implementationctrlaltb

Goto Type Declarationctrlshiftb

Goto Superctrlu

Opening Class/File/Symbol

1.打开新类:Ctrl+n

新创建一个类,可以很方便的看到类创建之后的路径。以及输入字母字母时候会有相关的提示名字,很智能。

2.Open File:ctrl+shift+n

用于打开在你项目中的文件。对于打开AndroidManifest.xml 或者任何在res/和 assets/ folder下的文件都非常有用。

3.Open Symbol:ctrl+alt+shift+n

通过输入方法或者变量的名字就可以直接打开。

4.部分匹配Partial Matching

即使输入不完整的字符串,它也可以帮你查找。比如ItemDetailFragment”, 你输入“IDF”就可以找到。

5.Line Number

查找在某个类某一行,可以用类名:行数,类名可以缩写。

比如:ExcitingClass:22 或者EC:22

recent file

1.Recently opened files:ctrl+e

显示你最近操作过的文件。

2.Recently edited files:ctrl+shift+e

和上面那句差不多,但只显示最近有编辑过的文件。

Navigate Back/Forward:ctrl+alt+left/right

Last Edit Location:ctrl+shift+backspace

Show Usage

1.In a Persistent Panel:alt+f7

Shows where something is used. For a class member, it will show where reads and writes are made. For a method, it will show where it is called. For a class, it will show where new instances are created.

2.In Place:ctrl+alt+f7

和上面一样,不过提示的地方在变量上方。上面提示的地方在左下角。

Goto Declaration/Implementation (Drill Down)

1.Goto Declaration去定义声明的地方

两种方式:ctrl+click或者用ctrl+b。

2.Goto Implementation:ctrl+alt+b

Shows a list of all the classes/interfaces implementing the selected class/interface. Also works on methods to find where they are implemented/overriden. On variables, it has the same effect as Goto Declaration。

3.Goto Type Declaration:ctrl+shift+b

类型声明:

When the caret is on a variable, it will go to the declaration of its type. For example, if I have the following line:

Developer phil = new Developer(“Phil”);

If the caret is on the variable “phil”, this shortcut will go to the declaration of the “Developer” class.

4.Goto Super:ctrl+u

打开当前 symbol的父类。

Pretty much the opposite of Goto Implementation. If the cursor is in an overriden method, it will open its parent implementation. If the caret is in a class but outside the method or on the class name, it will open the parent class.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: