I'm using android.support.constraint.ConstraintLayout
to layout a simple card's content views.
I'm getting random changes in my XML, every time, when:
- I switch to Android Studio's layout editor's
Design
tab - Or when I have a
Preview
pane turned on (in this case changes happens even more often during my changes).
Those random changes include:
- Removal of my manually defined layout margins (eg.
layout_marginEnd
) - Changing values of my manually entered margin value
- Adding
tools:layout_editor_absoluteX
values
Questions:
- Anyone else experience this Android Studio's feature?
- How to switch this "feature" off, so my layouts would not be destroyed?
- Where to report this bug to Google or JetBrains?
Please take a look to this file diff, which was made automatically when switched to Design tab:
PS.: My Android Studio version is 2.2.3
; I'm running it on macOS Sierra.
Update #1
As suggested, after making layout_height="match_parent"
, I get modifications less often, but still my XML gets messed-up, when I edit layout in Layout Design'er:
This time I wanted to set
layout_marginTop
through Design UI (selected line is what I wanted to add), but I also got those other unwanted changes:
layout_marginStart
removed;app:layout_constraintBottom_toBottomOf
referenced IDs got a prefix of "+" sign, which means, those IDs are newly declared, so when I'll useGoto declaration
functionality, I'll have to choose it from the list - not a desired behaviour.tools:layout_editor_absoluteX
gets added. I could ignore it, but still - not what I'd want to happen.