Newer (I guess 2.x+) versions of Android Studio have this option in the main settings:
Open the settings with one of the following actions:
- Press
Ctrl+Alt+S. - On the main menu, choose
File | Settingsfor Windows and Linux orIntelliJ IDEA | Preferencesfor OS X - Press
Ctrl+Shift+A, type settings and pressEnter.
Then navigate to the following sub-menu:
Editor -> Layout Editor -> "Prefer XML editor"
