XML code formatting gives wrong arranging child views in LinearLayout Android Studio 3.5 [duplicate]
Asked Answered
I

1

7

Menu -> Code -> Reformat Code

Previous Android Studio version, my hands are very used to click Ctl+Alt+L to format code whenever I have typed some code block. After I updated to Android Studio 3.5, I formatted the code in XML and it is giving me wrong arrangement of my views and destroying my design.

Here is the design before code reformatting.

enter image description here

After code reformatted (click -> Ctl+Alt+L), my views was shuffled in both design and xml code side. please see second picture.

enter image description here

It seems a bug and I already reported it to Google Issue Tracker.

Indisposed answered 27/8, 2019 at 9:38 Comment(0)
I
19

I just got answer from one of my colleague. That works well.

Settings -> Editor -> Code Style -> XML-> Set From -> Predefined Style > Android.

enter image description here

Indisposed answered 27/8, 2019 at 9:52 Comment(2)
This worked for me. Very sneaky bug with Android Studio 4+Mamoun
What on Earth IS this? I've never had to do anything like this before. Suddenly, Android Studio no longer understands how to format its own layouts without destroying them BY DEFAULT? I mean, this sounds perfectly like an Android thing, but still...Arrogance

© 2022 - 2024 — McMap. All rights reserved.