Shortcut to switch between design and text in andr

2019-02-01 03:12发布

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.

10条回答
beautiful°
2楼-- · 2019-02-01 03:48

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.

查看更多
乱世女痞
3楼-- · 2019-02-01 03:50

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
查看更多
霸刀☆藐视天下
4楼-- · 2019-02-01 03:51

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

CTRL + SHIFT + LEFT/RIGHT on MAC

查看更多
甜甜的少女心
5楼-- · 2019-02-01 03:52

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

(Mac) : control + shift + ← / →

(Windows / Linux): alt + shift + ← / →

查看更多
登录 后发表回答