欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

listview数据显示逐次渐现动画效果

程序员文章站 2022-01-28 21:53:47
...
private ListView listPaking;
if (getActivity() != null) {
    getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            adapter = new PakingAdapter(getActivity(), list);
            listPaking.setAdapter(adapter);
            //动画效果
            AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
            alphaAnimation.setRepeatCount(0);
            alphaAnimation.setDuration(5000);
            alphaAnimation.setRepeatMode(alphaAnimation.REVERSE);
            listPaking.startAnimation(alphaAnimation);
        }
    });
}
相关标签: 动画