Android RecyclerView实现下拉刷新和上拉加载

2019-12-10 18:00:17于海丽

OK。肯定有小伙伴使用该框架时一直报错,为什么,看框架的源码,有如下一段

this.mHeaderView = this.findViewById(id.swipe_refresh_header);
 this.mTargetView = this.findViewById(id.swipe_target);
 this.mFooterView = this.findViewById(id.swipe_load_more_footer);

可以看出,作者是根据固定的id值获取的,所以在我们的布局文件中,必须使用固定的三个id。

如有需求,可移步我的github获取源码,源码在systemwidgetdemo中。

以上就是本文的全部内容,希望对大家学习Android软件编程有所帮助。



注:相关教程知识阅读请移步到Android开发频道。