0
点赞
收藏
分享

微信扫一扫

扫描简单动画

心存浪漫 2023-02-22 阅读 50


ImageView mQrLineView = (ImageView) findViewById(R.id.scan_line);
TranslateAnimation mAnimation = new TranslateAnimation(TranslateAnimation.ABSOLUTE, 0f,
TranslateAnimation.ABSOLUTE, 0f, TranslateAnimation.RELATIVE_TO_PARENT, 0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0.9f);
mAnimation.setDuration(1500);
mAnimation.setRepeatCount(-1);
mAnimation.setRepeatMode(Animation.RESTART);
mAnimation.setInterpolator(new LinearInterpolator());
mQrLineView.setAnimation(mAnimation);

<RelativeLayout
android:id="@+id/box_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:background="#000">

<ImageView
android:id="@+id/scan_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:background="@drawable/line" />
</RelativeLayout>


举报

相关推荐

0 条评论