Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.5 - Formatting (ctrl+Alt+L) the code in XML file is rearranging the Views in the LinearLayout [duplicate]

Recently I have updated to Android Studio 3.5. I have three views: an EditText, a TextView and a Button inside a vertical LinearLayout(ViewGroup) named sample.xml file. When I format the stuff by pressing ctrl+alt+L, all the views get rearranged automatically. In my case the Button view which is in the bottom has reached to top after formatting, also EditText and TextView which is in top first and second are rearranged in second and third position respectively in vertical LinearLayout.

Android Studio : 3.5

Android Gradle Plugin: 3.5.0

Gradle: 5.4.1

JRE: 1.8.0_202-release-1483-b03x64

OS: Windows 8.1(amd64) v6.3

like image 863
Shashi Shiva L Avatar asked Aug 28 '19 05:08

Shashi Shiva L


1 Answers

Please try below settings that worked for me

Settings -> Editor -> Code Style -> XML-> Set From -> Predefined Style > Android.
like image 108
Jignesh Mayani Avatar answered Nov 06 '22 05:11

Jignesh Mayani