我见过各种各样的代码,这让我觉得我的应该可以工作,但由于某种原因它没有。我有一个ImageView,可以垂直向下调整另一个图像,并且我希望移动图像视图在动画完成后消失,但不会。 '扫描条'imageview是有问题的。它在XML中设置为不可见,并在按钮按下时可见。动画完成后,我需要它消失。ImageView相对布局中的可见性问题
public class scan extends Activity {
EditText Quote;
private static final Random rgenerator = new Random();
ImageView scanbar;
public void scanLine() {
// Displays the scanline animation over the wireframe image
ImageView wireframe;
scanbar = (ImageView)findViewById(R.id.scanbar);
wireframe = (ImageView) findViewById(R.id.wireframe);
scanbar.setVisibility(View.VISIBLE);
// Super ultra-secret code
}
Animation.AnimationListener scanListener = new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
scanbar.setVisibility(View.INVISIBLE);
setResults();
}
};
setResults();调用工作正常,所以我知道这段代码正在执行。任何人都知道我在做什么错了?
你在用什么动画帧? – user710502
这是一个将图像从框架顶部移动到底部的翻译动画 – Carnivoris