Make Text tab open by default in Android Studio
Asked Answered
P

5

42

I use keymaps in Android Studio to save time.

To open "Recent Files" I happen to use the keymap of CMD+ E, which will open the "Recent Files" pop-up screen.

The problem is that when I then select any of the .xml layout files from this screen, it opens the file by default in "Design" mode, instead of "Text".

I prefer to code my layouts in "Text" mode. This means I then have to keyboard shortcut CTRL+ SHIFT + -> every time to edit the layout in "Text" mode. How do I open "Text" mode by default.

Note: I would post images, but that is reputation dependent...

Phonics answered 22/7, 2015 at 9:21 Comment(1)
P
78

Open Settings:

File -> Settings -> Editor -> Layout Editor -> check the checkbox "Prefer XML Editor"
Perspicacity answered 26/2, 2016 at 16:58 Comment(3)
For me to actually make it work AS restart was needed.Occupancy
Great little option. No restart needed for me. Thanks!Eteocles
Currently can be found in: File -> Settings... -> Editor -> Layout EditorIndigence
F
7

In newer versions of Android Studio you can find the setting mentioned by Andrey under Preferences > Editor > Layout Editor. ("Prefer XML editor")

A restart is not required.

Farnesol answered 27/9, 2016 at 18:13 Comment(1)
Strange, this didn't work for me without restart, and what's worse, still doesn't work after restarting...Hereld
L
6

Currently it's can be found under "Preferences" -> "Editor" -> "Design Tools" -> "Default editor mode" section

Linguistician answered 7/12, 2022 at 15:6 Comment(0)
S
2

In Android Studio 3.0 for MacOS

Android Studio -> Preferences -> Editor -> Layout Editor

Screenshot - Prefer XML Option

Sufism answered 7/11, 2017 at 2:35 Comment(0)
M
0

On Mac: Cmn + Shift + A -> prefer XML...

On Win/Lin: ctrl + Shift + A -> prefer XML...

Midweek answered 1/4, 2019 at 11:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.