Android Studio Collapse definitions and methods

自闭症网瘾萝莉.ら 提交于 2019-11-27 17:13:49
free3dom

It is called Folding in Android Studio.

First make sure it is enabled in config (it should be by default). Go to File -> Settings, then under the IDE Settings area find Editor -> General -> Code Folding, check the Show code folding outline.

To collapse/expand items use the Code -> Folding menu.

Edit:
To customize the keyboard shortcuts for these open Settings (File -> Settings) then select Keymap under IDE Settings. Now type folding into the search box (top right). Setup the keyboard shortcut for the various folding actions :)

Fazal

For Windows:

  Minimize: CTRL + SHFT + '-'
  Expand:   CTRL + SHFT + '+'

For Mac:

  Minimize: COMM + SHFT + '-'
  Expand:   COMM + SHFT + '+'

Here's screenshot for quick reference:

View -> Tool Windows -> Structure

It's the equivalent to outline in eclipse. It gives you a far better overview of the class than folding.

my macbookpro

shift + cmd + ¡ (character or button before delete) Expand All

shift + cmd + ' (character or button after zero) Collapse All

windows

ctrl + shift + + Expand All

ctrl + shift + - Collapse All

cutiko

This is valid for windows users:

  1. Select a bunch of code, then press ctrl+.. This folds your block
  2. Then to remove the folding, move to the first line where the fold starts. Don't select the code, just click in that first line, and again press ctrl+.
Levi Ibrushi

This work for me in Windows:

minimize: CTRL + SHIFT + -

expand: CTRL + SHFT + +

New Android Studio come up with a lot of new functions. These are the commands you can use to fold different type of code.

If you want turn off all collapsing you need uncheck all fields in the Settings > Editor > General > Code Folding

Also you can use hot keys

ctrl + shift + + — expand code blocks

ctrl + shift + - — collapse code blocks

(for windows)

If you are talking about editor fold just like fcom + tab in netbeans

ctrl + alt+ t and then add desired text in the desc block

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!