Android 13中Object Animator移动ViewGroup出现裁剪问题
Android 13上ViewGroup沿Y轴平移动画被裁剪问题
我通过Object Animator实现一个ViewGroup沿Y轴向上平移的动画,在Android 13设备上运行时,该ViewGroup向上移动过程中会被裁剪,而Android 10设备上运行完全正常。
设备运行效果
- Android 13设备:
- Android 10设备:
动画实现代码
val totalAnimationDuration = 2000L val context = cameraUIBinding!!.stepsLayout.context val moveOutAnimator = ObjectAnimator.ofFloat( cameraUIBinding!!.stepsLayout, "translationY", -context.dpToPx(200f) ) .apply { duration = totalAnimationDuration interpolator = LinearInterpolator() repeatCount = 5 } moveOutAnimator.start()
Android Studio布局截图

内容的提问来源于stack exchange,提问作者Chinmay
相关产品推荐
相关产品推荐

