Constraint layout's width and height attributes automatically reset to 0dp

1.9k views Asked by At

So I have this weird and annoying problem about constraint layouts - some of the views inside Constraint layout change width and height to 0dp from custom value WITHOUT ASKING OR NOTIFYING. This behavior is not consistent as well because I will build my layouts, I will test them, I will be happy and move on to a next thing, but then hours later I will see that the values are set back to 0dp and layouts are all messed up. Good thing that uncommitted files in android studio turn blue, so I can simply notice this undesired changed and ctrl+z

I have just recently starting implementing and converting variety of layouts to constraint layouts, so there might something that I have missed out? Does anyone what could be a cause of this very undesired behavior?

My layout structure is this

Root - Constraint Layout
  views
  views
  ViewPager
    Constraint Layout
       Constraint Layout
       Constraint Layout

Constraint layout does include another constraint layouts but I don't think that should cause any issues

Edit: I am currently using Android Studio 3.0 Canary 7, developing much more complex layouts and I this issue have not occurred since upgrading to 3.0

1

There are 1 answers

0
MidasLefko On

This bug report on Android issue tracker might be what you are looking for. If not I recommend submitting your own report.