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