我发现这样做的唯一方法是首先移动你的 imageview 位置,使用 setLayoutParams 和新的边距,然后你才使用 (-x, -y, 0, 0) 启动 TranslateAnimation 所以对于我在问题中的具体情况,这是我的代码:
TranslateAnimation tweenAnim = new TranslateAnimation(-1 * XStep, -1 * YStep , 0, 0);
tweenAnim.setDuration(number_of_steps * 750);
tweenAnim.setFillAfter(true);
tweenAnim.setFillEnabled(true);
tweenAnim.setInterpolator(new LinearInterpolator());
//layout positioning
lp.leftMargin += XStep;
lp.bottomMargin += YStep;
imageView.setLayoutParams(lp);
Log.v(TAG, "leftMargin=" + lp.leftMargin);
Log.v(TAG, "bottomMargin=" + lp.bottomMargin);
imageView.startAnimation(tweenAnim);
这是一个巨大的痛苦。严重地。感谢http://www.clingmarks.com/?p=400我能够克服它。