Android Studio 3.2.1, XML bad indent format

旧巷老猫 提交于 2019-12-04 17:17:30

问题


After updating to Android Studio 3.2.1 the XML files format is very annoying and bad, how can we fix it? Can we change it from somewhere in settings to previews type?


回答1:


You can edit your code styles under File > Settings > Editor > Code Style > XML

If you want to preview a specific file, just paste that file's contents into the preview window.




回答2:


On Android Studio 3, Go to :

Preferences > Editor > Code style > XML then on Scheme switch to Default instead of Project.

You can then use those shortcuts to indent your code:

Windows:

Ctrl + Alt + L

macOS:

Option + Command + L




回答3:


Open File > Settings > Editor > Code Style > XML

Now in layout file make sure you have selected wrap attributes as Wrap always.
Screenshot



来源:https://stackoverflow.com/questions/53196252/android-studio-3-2-1-xml-bad-indent-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!