ObjectAnimatorで下記のTranslateAnimationのようなアニメーションを実現したいのですが親要素に対して割合で移動距離を設定するような方法が分かりません。
今現在下記のように動かすまではできたのですがどのような方法を使えば移動距離を親要素の割合で設定できますか?
よろしくお願いします。
TranslateAnimation translateAnimation = new TranslateAnimation( android.view.animation.Animation.RELATIVE_TO_PARENT, 0.0f, android.view.animation.Animation.RELATIVE_TO_PARENT, 0.0f, android.view.animation.Animation.RELATIVE_TO_PARENT, 0.0f, android.view.animation.Animation.RELATIVE_TO_PARENT, 0.9f ); コード
PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("translationX",fromX,toX); PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("translationY",fromY,toY); ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(imageViewsKa[i],holderX,holderY); コード
あなたの回答
tips
プレビュー