Android Animate view from the screen does not work

I have a view that is fully placed on the screen, and I'm trying to animate it on the screen.

When i call:

view.startAnimation(tA);

nothing happens, tA.initialize and tA.applyTransformation are never called.

If I move the view so that any part of it is visible before the animation starts, the animation works correctly.

What prevents you from animating a view when it is outside the parent view?

+5
source share
2 answers

As far as I understand, exploring the same problem that Android Animations do not succeed when provided coordinates for their launch or completion.

Android forums have a dialog box about this error, but I'm still experiencing problems in 4.2.

Edit:

, , API (ObjectAnimator).

View view = this;
ObjectAnimator anim = ObjectAnimator.ofFloat(view, "y", 0, 100);
anim.setDuration(super.animationDuration());
anim.start();

ObjectAnimator.ofFloat(view, "y", 0, 100);

ObjectAnimator.ofFloat(Object objBeingAnimated, String propertyBeingAnimated, float startValue, float endValue)
+1

, ValueAnimator, MarginLayoutParams.topMargin ( ) onAnimationUpdate(), . , .

ObjectAnimator , , , TranslateAnimation.

0

All Articles