var adapter = new DataAdapter(this, data.ToList()); var alphaAdapter = new AlphaInAnimationAdapter(adapter); recyclerView.SetAdapter(alphaAdapter);
为RecylerView使用RecylerViewAnimators组件中提供的适配器动画,须要使用RecyclerView类中的SetAdapter()方法,其语法形式以下:动画
RecyclerView.SetAdapter(Android.Support.V7.Widget.RecyclerView.Adapter)
其中,animator参数指定一个适配器动画,这个动画就是表1-2中列出的内容。例如,下面代码演示在RecylerView中使用适配器动画:this