Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure spacing before closing XML tag on Android Studio?

When applying "Reformat command" (++L) on a XML file Android Studio adds a space before closing tags.

For example, the following code

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/panic"/>

After "Reformat code" will become

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/panic" />

Is it possible to avoid that? Where can I configure the space before closing XML tags?


I'm using Android Studio 2.1.2 on MacOSX El Capitan 10.11.5.

like image 753
GabrielOshiro Avatar asked Sep 16 '25 18:09

GabrielOshiro


1 Answers

This is one of the options.

Settings->Editor->XML->"Other" Tab. In the Spaces group uncheck in empty tag.

like image 175
L. Sturtevant Avatar answered Sep 18 '25 10:09

L. Sturtevant