CaptureActivity中有一条扫描仪线。现在我想添加一个TranslateAnimation,让线条从“热区”的顶部移动到底部,但它根本不光滑。我不知道为什么?
这是一段代码摘要
FrameLayout.LayoutParams linearParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT);
linearParams.width = width;
mImageView.setLayoutParams(linearParams);
mImageView.invalidate();
mImageView.setVisibility(View.VISIBLE);
mTranslateAnimation.setDuration(3000);
mTranslateAnimation.setRepeatCount(Animation.INFINITE);
mImageView.startAnimation(mTranslateAnimation);
有什么想法吗?