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

1

19

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

Lyontine answered 28/8, 2019 at 5:44 Comment(2)
i was also facing the same issue. I deleted the configuration and then all were goodFielder
this happpens when you upgrade the android studio.Try uninstalling the 3.5 and make a fresh install.Orthoscope
G
55

Please try below settings that worked for me

Settings -> Editor -> Code Style -> XML-> Set From -> Predefined Style > Android.
Gerge answered 28/8, 2019 at 5:54 Comment(4)
Thanks, it is working!!!Uranography
I did this and worked.Preiser
I wonder how it got funky in the first place...Ambience
Thanks. You saved lives :pSiobhansion

© 2022 - 2024 — McMap. All rights reserved.