qq_36340344
hnahdfhb
2017-01-17 02:32

android ValueAnimator改变控件宽度实现收缩展开卡顿怎么破?

20
  • 控件
  • android
  • 动画
    ValueAnimator colseAnimator = ValueAnimator.ofFloat(closeWidth, 0);
    colseAnimator.addUpdateListener(new AnimatorUpdateListener() {

        LinearLayout.LayoutParams params = (LayoutParams) 
                closeView.getLayoutParams();
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {

            float f = (Float) animation.getAnimatedValue();
            params.width = (int) f;
            closeView.requestLayout();
        }
    });
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答