美文网首页
ViewGroup显示隐藏子View的动画效果

ViewGroup显示隐藏子View的动画效果

作者: 饮料只喝芬达 | 来源:发表于2022-08-16 16:57 被阅读0次

    转载,该博客写的比较简单明了了,记录一下

            binding.sendRoot.apply {
                val transitioner = LayoutTransition()
    
                transitioner.setAnimator(
                    LayoutTransition.APPEARING, ObjectAnimator.ofFloat(
                        null, "translationX", -126.dpf, 0f
                    ).setDuration(250)
                )
                transitioner.setAnimator(
                    LayoutTransition.DISAPPEARING, ObjectAnimator.ofFloat(
                        null, "translationX", 0f, (-126).dpf
                    ).setDuration(250)
                )
                transitioner.setStagger(LayoutTransition.CHANGE_APPEARING, 250)
                transitioner.setStagger(LayoutTransition.CHANGE_DISAPPEARING, 250)
                transitioner.setStagger(LayoutTransition.CHANGING, 250)
                layoutTransition = transitioner
            }
    

    相关文章

      网友评论

          本文标题:ViewGroup显示隐藏子View的动画效果

          本文链接:https://www.haomeiwen.com/subject/gnqdgrtx.html