我将动画设置为gridView的一项,并且效果很好,但是在notifyDataSetChanged之后,动画不起作用。
gridViewAdapter = new GridViewAdapter (context, myArray);
gridView.setAdapter(gridViewAdapter);
Animation animation = AnimationUtils.loadAnimation(this,R.anim.animation);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView parent, View view, int i, long l) {
//change myArray items
gridViewAdapter.notifyDataSetChanged();
view.startAnimation(animation);
}
});