android:visibility changes to children of MotionLayout

前端 未结 5 1811
灰色年华
灰色年华 2020-12-05 10:18

I must be missing something with android:visibility changes within a motion layout. Here’s a simplified version of my layout.


 

        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 10:57

    Turns out this was my inexperience with how MotionLayout works. By default MotionLayout controls the visibility of all views within it. But you can opt out child views by using the app:visibilityMode="ignore" attribute and defining the view in the

    In my case looks like this...

    
    

    And this is defined the same in both collasped and expended ConstraintSets as I don't want it to move/animation when the recycler view is scrolled.

    Thanks to John Hoford for the advice in another channel.

提交回复
热议问题