Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在为 android 开发一个应用程序,该应用程序有球被射向一个化身。我有一个在 xml 文件中定义的动画,我希望它在动画期间将一个变量更改为执行动画当前 x 坐标的 imageview 或它的 leftMargin 将是什么。
ImageView view=(ImageView)findviewByid("Your Image id"); TranslateAnimation anim = new TranslateAnimation( 0, xDest , 0, yDest ); anim.setDuration(1000); anim.setFillAfter( true ); view.startAnimation(anim);
使用它会起作用