我尝试了很多次尝试但未能解决。我想通过改变不断变化的垂直偏差来动画视图。那我怎么能打败这个呢?
ValueAnimator animator = ValueAnimator.ofInt(100, percent);
animator.setDuration(2000);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
ViewGroup.LayoutParams params = mViewTop.getLayoutParams();
float v = ((Float.parseFloat(animation.getAnimatedValue().toString())) / 100f) -0.1f;
if (v<0){
v=0;
}
params.verticalBias = v;
mViewTop.setLayoutParams(params);
}
});
animator.start();
慕村225694
相关分类