使用TwinklingRefreshLayout开源框架采坑:
1.在TwinklingRefreshLayout控件中添加RecyclerView等列表控件不能再添加别的控件(TextView)否则会造成如下的混乱界面(滑动过程)
2.如果添加LinearLayout会造成RecyclerView中数据填充不完,只有一个手机的界面的数据,所以在布局中尽量注意,下面代码是我采坑后的成果,如果不添加列表类控件则没有这个问题
<?xml version="1.0" encoding="utf-8"?>
<com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
</com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>