创建动画
来源:互联网 发布:import java 编辑:程序博客网 时间:2024/06/13 03:45
1、在布局文件里添加
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.28"
android:background="@drawable/tupian1" />
2、在drawable-hdpi里添加tupian1
3、在mainActivity里添加代码
imageView=(ImageView)findViewById(R.id.imageView);
//创建帧动画对象
animationDrawable=new AnimationDrawable();
animationDrawable.addFrame(getResources().getDrawable(R.drawable.tupian1), 100);
animationDrawable.addFrame(getResources().getDrawable(R.drawable.tupian2), 100);
imageView.setBackground(animationDrawable);
public void startKill(View v){
animationDrawable.start();
}
public void stopKill(View v){
if(animationDrawable.isRunning())
animationDrawable.stop();
}
- 创建动画
- 如何创建动画
- symbian--创建动画
- cocos2d 创建动画
- 15.2 创建动画值
- 15.5 创建动画
- 创建动画窗口
- Matlab 创建电影动画
- CCAnimation创建动画
- 创建图片动画
- CALayer的动画创建
- cocos2dx 动画创建
- cocos2dx 创建帧动画
- 使用plist创建动画
- 创建帧动画
- Unity创建UV动画
- 创建spine动画
- 创建帧动画
- C#控制台基础 将byte类型以十六进制字符串的形式输出
- P1983 车站分级(拓扑排序)
- C++大数加法乘法
- css 文本超出添加省略号
- K:java枚举的常见用法
- 创建动画
- leetcode 448. Find All Numbers Disappeared in an Array
- C2065'not_equal_to': undeclared identifier
- Mat类简单用法(一)
- Android内存泄漏优化总结
- HDU
- 手把手教你如何玩转SSM(Spring+SpringMVC+Mybatis)
- win10下安装Ubuntu后,启动时没有win10选项解决方法
- fatal error C1051: program database file