2014-08-30 10 views
2

해결되지.포팅은 - 방법은 내가 돌아 API < 내가 그렇게 할 수있는 nineoldandroid 라이브러리를 사용하고 11</p> <p>에 포트 <a href="http://developer.android.com/training/animation/zoom.html" rel="nofollow">http://developer.android.com/training/animation/zoom.html</a>에 노력하고있어

 AnimatorSet set = new AnimatorSet(); 
     set.play(ObjectAnimator 
       .ofFloat(expandedImageView, View.X, startBounds.left)) 
       .with(ObjectAnimator 
         .ofFloat(expandedImageView, 
           View.Y, startBounds.top)) 
       .with(ObjectAnimator 
         .ofFloat(expandedImageView, 
           View.SCALE_X, startScaleFinal)) 
       .with(ObjectAnimator 
         .ofFloat(expandedImageView, 
           View.SCALE_Y, startScaleFinal)); 

을 내가 이것을했습니다 :

AnimatorSet set = new AnimatorSet(); 
set.playTogether(
     ObjectAnimator.ofFloat(expandedImageView, View.X, startBounds.left, finalBounds.left), 
     ObjectAnimator.ofFloat(expandedImageView, View.Y, startBounds.top, finalBounds.top), 
     ObjectAnimator.ofFloat(expandedImageView, View.SCALE_X, startScale, 1f), 
     ObjectAnimator.ofFloat(expandedImageView, View.SCALE_Y, startScale, 1f) 
); 

View.X, View.Y, View.SCALE_X 및 View.SCALE_Y이 허용되지 않습니다 그러나 그러나 이해할 수없는 nineoldandroid이 부분이있다 .

이이

답변

2

내 초기 추측이 맞았다?, translationY "와"scaleX가 ","scaleY를 ""translationX "문자열로 대체해야하지만, playTogether 필요하지 않았다.

이 있었다 솔루션 :

set 
     .play(ObjectAnimator.ofFloat(expandedImageView, "translationX", startBounds.left, finalBounds.left)) 
     .with(ObjectAnimator.ofFloat(expandedImageView, "translationY", startBounds.top, finalBounds.top)) 
     .with(ObjectAnimator.ofFloat(expandedImageView, "scaleX", startScale, 1f)) 
     .with(ObjectAnimator.ofFloat(expandedImageView, "scaleY", startScale, 1f));