Android frame 动画 (10k图片) 超过15张 报内存溢出
来源:互联网 发布:浙江金税三期软件下载 编辑:程序博客网 时间:2024/04/28 11:20
在 xml中 按顺序添加动画的图片 ,如果每张10k左右 最多添加15张左右 会报内存溢出的异常 所以适合少量的图片做的动画
android:oneshot="true"属性 设置是否自动播放。
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"android:oneshot="true" >
<item
android:drawable="@drawable/f1_00000" android:duration="35"/>
<item
android:drawable="@drawable/f1_00001" android:duration="35"/>
<item
android:drawable="@drawable/f1_00002"android:duration="35"/>
<item
android:drawable="@drawable/f1_00003" android:duration="35"/>
<item
android:drawable="@drawable/f1_00004" android:duration="35"/>
</animation-list>
2 在布局中应用
<ImageView
android:id="@+id/frame_image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
3 java中的代码
private ImageView image;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.solofengs);
image = (ImageView) findViewById(R.id.frame_image);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
image.setBackgroundResource(R.anim.solofeng);
AnimationDrawable anim = (AnimationDrawable) image.getBackground();
anim.start();
}
- Android frame 动画 (10k图片) 超过15张 报内存溢出
- android 查看多张图片 出现 内存溢出
- android 内存溢出 图片
- ViewPager加载多张图片出现内存溢出的解决办法
- iOS-解决SDWebImage加载多张图片内存溢出
- Android 解决 图片内存溢出
- Android图片处理内存溢出
- Android 多张图片形成动画
- Android 内存管理--------------图片太大内存溢出
- android很多图片做成帧动画造成内存溢出的解决方法。
- Android(开发):动画之Frame动画
- Android动画-Frame Animation(帧动画)
- Android使用帧动画内存溢出解决方法
- Android:动画:Frame动画
- android播放多张图片形成动画 (帧动画)
- Android 图片内存溢出(Out of Memory)
- Android网络图片加载内存溢出(OOM)解决方案
- Android--图片加载处理(内存溢出和三级缓存)
- Photoshop脚本 > 旋转当前选区
- List删除指定的元素
- 第十三周项目1-数组大折腾5
- 回文号码
- swift资料汇集
- Android frame 动画 (10k图片) 超过15张 报内存溢出
- Photoshop脚本 > 设置选区的边框
- 计数排序
- 第十三周OJ平台(3):统计元音字母个数
- Photoshop脚本 > 给选区添加描边效果
- hive学习笔记-正则匹配篇
- 关于ARGB_8888、ALPHA_8、ARGB_4444、RGB_565的理解
- 苹果OS X 10.10.1更新啦,WiFi热点连接问题留存
- Yii Framework 在页面底部查看SQL语句配置