Listview和动画
|
我正在使用API DEMOS的listview动画,示例2。这是OnCreate方法的代码段:
ListView listview = (ListView) findViewById(android.R.id.list);
AnimationSet set = new AnimationSet(true);
Animation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(50);
set.addAnimation(animation);
animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
animation.setDuration(200);
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
listview.setLayoutAnimation(controller);
在将来的某个时候,将在列表的适配器上调用“ 1”,并且刷新了我的列表。但项目不再显示在动画中。
请帮忙。
没有找到相关结果
已邀请:
2 个回复
骨酚柯
襄挟款籍
:适配器的数据源不再可用。 在这里,您可以找到正在使用的具有
功能的工作样本。也许它也会解决您的动画问题。