Darren Martin Leith
Darren Martin Leith

Reputation: 432

Make Text tab open by default in Android Studio

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...

Upvotes: 43

Views: 4515

Answers (7)

EunhaEonnie
EunhaEonnie

Reputation: 235

For android studio ladybug

Settings -> Editor -> UI Tools

enter image description here

Upvotes: 1

Renan Ferrari
Renan Ferrari

Reputation: 2529

Updated instructions for Android Studio Ladybug Feature Drop | 2024.2.2 on MacOS:

  1. Go to SettingsEditorUI Tools.
  2. Under the Editor View Mode section:
    • Set Resource and/or Kotlin dropdowns to Code instead of Design.
  3. Click Apply to save the changes.

settings screenshot

Upvotes: 3

Dmitriy P
Dmitriy P

Reputation: 113

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

Upvotes: 7

Maksim Turaev
Maksim Turaev

Reputation: 4335

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

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

Upvotes: 0

superheron
superheron

Reputation: 363

In Android Studio 3.0 for MacOS

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

Screenshot - Prefer XML Option

Upvotes: 2

Andrew
Andrew

Reputation: 37969

Open Settings:

File -> Settings -> Editor -> Layout Editor -> check the checkbox "Prefer XML Editor"

Upvotes: 78

Adrian Stabiszewski
Adrian Stabiszewski

Reputation: 83

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.

Upvotes: 7

Related Questions