0
我想用30帧做帧动画。 我对相同的代码是:如何优化框架动画?
animation = new AnimationDrawable();
for (int i= 1; i<= 30 ; i++){
frame= "xyz"+ i;
resource = this.getResources().getIdentifier(frame, "drawable", "com.example.frameanimation");
Log.e("123", "resource value======"+resource+"============"+frame);
animation.addFrame(getResources().getDrawable(resource), 50);
System.gc();
}
animation.setOneShot(false);
在这段代码中我已经包括System.gc();
。这会帮助我优化内存相关问题吗?或者它仍然可以提供与内存相关的问题。这是否意味着在帧动画中存在于内存中的30张图像将被破坏。
有没有其他的方法来优化这个? 建议请。
在此先感谢。
我无法点击您提供的链接。 – Vaibs 2013-03-18 07:28:19