127

Does anyone know some shortcut to switch between design and text in android studio while editing XML layout?

While I can switch from design view to source using Ctrl+B (and need to select something in layout before), I have no way to go back.

Lii
  • 11,553
  • 8
  • 64
  • 88
MainActivity
  • 1,650
  • 2
  • 12
  • 16

14 Answers14

147

You can find it in Preferences->KeyMap:
"Select next Tab in multi-editor file":

enter image description here

The keymap depends on the platform:

  • On Mac: CRTL+SHIFT+RIGHT
  • On windows/Linux it is ALT + Shift + Left/Right.

You can change it on the KeyMap panel.

You can find the buttons to switch between design, text and preview in top right bar:

photo

With Android Studio Arctic Fox 2020.3 you can find the buttons to switch between code|split|design:

enter image description here

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • 36
    On windows it is ATL+SHIFT+RIGHT/LEFT – vijay_t Dec 18 '15 at 12:11
  • This answer shows the key command to search for. I usually change such keystrokes to something I can remember. – brainray Jan 11 '16 at 12:11
  • Very weird - some shortucts (not coverd by other stuff) doesnt work for this option - for example I can set it to cmd+shift+N but not to cmd+shift+D - eventho both shortcuts are not used. Never happened to me in Intellij before – Srneczek Jun 20 '16 at 18:27
  • In Linux(for me) and probably other platforms a RESTART in required for it to apply the changes. – Siamak Jan 30 '20 at 07:34
  • 2
    May need restart Android Studio. – Sam Chen Oct 04 '20 at 16:19
110

ALT + Shift + Left/Right works for me. (Windows)

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
cifuentes
  • 1,229
  • 1
  • 8
  • 6
35

ALT + SHIFT + LEFT/RIGHT on windows and ubuntu.

CTRL + SHIFT + LEFT/RIGHT on MAC

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
Shivansh
  • 906
  • 12
  • 25
15

Move between Design / Text tabs in layout’s view:

(Mac) : control + shift + /

(Windows / Linux): alt + shift + /

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
Tharindu
  • 321
  • 3
  • 5
5

Good Question:

There are 2 ways:

  • If You are on a Activity ( Design or Text)

    1) left click on Text or Design 2) ALT + SHIFT + Right/Left arrow key

  • If You are on a class

    1) click on the name of the activity: example: click on activity_actividad2_blank setContentView(R.layout.activity_actividad2_blank);

    2) click on Project goto to java class left click on class and click on "Find Usages" ( Or ALT + F7) double click on result you want to go.

Have a good programming.

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
user3220499
  • 51
  • 1
  • 2
  • Not a good answer. You are proposing to use the mouse, and shortcuts are designed to avoiding using it – voghDev May 10 '17 at 11:35
4

In Windows it's ALT + SHIFT + Left / Right for Android Studio 3.4

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
Mohamed Abulnasr
  • 589
  • 7
  • 18
3

(CTRL + SHIFT) + LEFT or RIGHT arrow keys,

To go back and forth in between Design tab and Text(XML) tab, on Mac OS X.

Randika Vishman
  • 7,983
  • 3
  • 57
  • 80
2

Although the question is related to switching between design and xml views, many people may be looking for or interested in how to switch between related XML and Java files. This can be achieved in Android Studio, using the Related Symbol... navigation key mapping.

Depending on your settings and operating system the keyboard shortcut will vary, but you can find out what yours is by looking in Settings -> Keymap -> Main menu / Navigate / Related Symbol...

Otherwise try the following keys:

  • Ctrl + Alt + F7
  • Ctrl + Alt + Home
  • Meta + Ctrl + Up
Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
TheIT
  • 11,919
  • 4
  • 64
  • 56
2

ALT+SHIFT+RIGHT ARROW worked for me on ubuntu

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
2

alt + shift + left/right arrow keys worked for me in Windows 10 in Android Studio 3.5.

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
Vivek Pratap Singh
  • 1,564
  • 16
  • 26
1

The settings for it is under Settings->Keymap->Other->Select Next Tab in multi-editor file, for Android 3.0.1.

felixy
  • 179
  • 1
  • 6
1

I wanted to switch to the selected View in question. None of the answers did that. So, here we go:

CTRL + B

Period.

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
0

On Android Studio 2.3+, one can use the shortcut Ctrl+T.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
Jay
  • 53
  • 1
  • 10
0

Buttons are available to switch between design and text window in XML file in android studio 3.6.1. Shortcut keys are: ALT + Shift + Left/Right works for me. (Windows)

Top Right side buttons

Ali Sher Kashif
  • 2,133
  • 2
  • 11
  • 13