android 简单图片动画播放的实例代码
时间:2023-11-07 12:39:01
xml中:
<ImageView
android:id="@+id/touchview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="@drawable/touch" />
java中:
mTouchView = (ImageView) findViewById(R.id.touchview);
AlphaAnimation mAlphaAnimation = new AlphaAnimation(0.1f, 1.0f); ////创建一个AlphaAnimation对象,参数从透明到不透明
mAlphaAnimation.setDuration(1000);// 设定动画时间
mAlphaAnimation.setRepeatCount(Animation.INFINITE);//定义动画重复时间
mAlphaAnimation.setRepeatMode(Animation.REVERSE);//通过设置重复时间定义动画的行为
mTouchView.setAnimation(mAlphaAnimation);
mAlphaAnimation.start();
标签:图片,动画,播放
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Android 仿苹果IOS6开关按钮
2023-11-21 15:16:08
![](https://img.aspxhome.com/file/2023/5/138885_0s.gif)
Android 7.0调用相机崩溃详解及解决办法
2023-08-08 21:39:42
![](https://img.aspxhome.com/file/2023/7/137447_0s.png)
java向多线程中传递参数的三种方法详细介绍
2023-07-11 21:52:55
c++ 函数指针相关总结
2022-09-26 04:42:33
Java操作文件输出为字符串以及字符串输出为文件的方法
2022-02-01 19:32:45
微信小程序 navigator 跳转url传递参数
2022-03-17 05:46:56
![](https://img.aspxhome.com/file/2023/1/92651_0s.png)
SpringBoot如何读取war包jar包和Resource资源
2023-11-09 01:40:44
WPF实现倒计时转场动画效果
2023-01-10 11:46:23
![](https://img.aspxhome.com/file/2023/9/119469_0s.png)
详解JAVA类加载机制(推荐)
2021-08-10 04:43:10
测试stringbuilder运行效率示例
2023-06-02 04:01:34
Java有哪些操作字符串的类?区别在哪?
2021-06-02 14:50:54
SharedPreference 初始化源码解析
2023-11-13 07:00:43
Java链表中元素删除的实现方法详解【只删除一个元素情况】
2023-01-16 11:49:41
![](https://img.aspxhome.com/file/2023/3/68693_0s.png)
SpringMVC解析JSON请求数据问题解析
2023-06-02 21:41:32
![](https://img.aspxhome.com/file/2023/8/60578_0s.png)
Android CountDownTimer实现定时器和倒计时效果
2023-12-09 02:11:28
java使用jdbc链接Oracle示例类分享
2022-06-25 19:18:58
Java 集合中的类关于线程安全
2023-03-13 12:53:22
Spring @Retryable注解轻松搞定循环重试功能
2022-12-17 06:07:51
C# httpwebrequest访问HTTPS错误处理方法
2021-10-31 02:40:49
使用工具类-java精确到小数点后6位
2021-06-24 20:45:39