安卓图片闪烁

上一篇 / 下一篇  2021-11-12 09:04:54 / 个人分类:安卓

图片放在 TextView中做背景,ID为blink_arrow

<TextView
android:id="@+id/blink_arrow"
android:layout_width="16dp"
android:layout_height="17dp"
android:layout_marginBottom="124dp"
android:layout_marginStart="122dp"
android:background="@drawable/slide_down"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />


final AlphaAnimation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible
animation.setDuration(1000); // duration - half a second
animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate
animation.setRepeatCount(Animation.INFINITE); // Repeat animation infinitely
animation.setRepeatMode(Animation.REVERSE); // Reverse animation at the end so the button will fade back in
TextView blink_arrow = (TextView) findViewById(R.id.blink_arrow);
blink_arrow.setAnimation(animation);

TAG: 安卓

 

评分:0

我来说两句

我的栏目

日历

« 2024-03-25  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

我的存档

数据统计

  • 访问量: 1181
  • 日志数: 4
  • 建立时间: 2021-11-11
  • 更新时间: 2021-11-13

RSS订阅

Open Toolbar