animateLayoutChanges does not work well with nested layout?

前端 未结 5 763
既然无缘
既然无缘 2020-12-07 18:57

I have a nested layout like the following:

      
        
              


        
5条回答
  •  独厮守ぢ
    2020-12-07 19:16

    We had added the android:animateLayoutChanges attribute to our LinearLayout but the change didn’t trigger an animation. To fix that, use this code:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    ((ViewGroup) findViewById(R.id.llRoot)).getLayoutTransition()
          .enableTransitionType(LayoutTransition.CHANGING);
    }
    

    More details.

提交回复
热议问题