ImageView mQrLineView = (ImageView) findViewById(R.id.capture_scan_line);
ScaleAnimation animation = new ScaleAnimation(1.0f, 1.0f, 0.0f, 1.0f);
animation.setRepeatCount(-1);
animation.setRepeatMode(Animation.RESTART);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration(1000);
mQrLineView.startAnimation(animation);
<RelativeLayout
android:id="@+id/capture_crop_view"
android:layout_width="340dp"
android:layout_height="340dp"
android:layout_below="@id/capture_mask_top"
android:layout_centerHorizontal="true"
android:background="@drawable/bg_scan">
<ImageView
android:id="@+id/capture_scan_line"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:src="@drawable/kakalib_scan_ray" />
</RelativeLayout>
------解决思路----------------------
可能自己画要稍微好一些,因为打开相机就是一件很费资源的操作,所以动画会表现得卡顿