然后在fragment应用 外层是viewpager+tablayout 滑动几次就会空白
MultipleStatusView 嵌套TwinklingRefreshLayout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white"> <com.classic.common.MultipleStatusView android:id="@+id/include_multiple_status_view" android:layout_width="match_parent" android:layout_height="match_parent" app:emptyView="@layout/custom_empty_view" app:errorView="@layout/custom_error_view" app:loadingView="@layout/custom_loading_view" app:noNetworkView="@layout/custom_no_network_view"
>
<!--scrollview布局-->
<com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout
android:id="@+id/include_refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--列表布局-->
<android.support.v7.widget.RecyclerView
android:id="@+id/include_recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/headview"
android:background="#fff"
android:focusableInTouchMode="false"
android:overScrollMode="never"
android:scrollbars="none" />
</com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>
</com.classic.common.MultipleStatusView>
然后在fragment应用 外层是viewpager+tablayout 滑动几次就会空白
遇到同样问题,层主解决了吗
问题解决了,看了源码,在onDetachedFromWindow做了清除视图工作,把这段代码注销掉就可以了
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
/*clear(mEmptyView, mLoadingView, mErrorView, mNoNetworkView);
if (!mOtherIds.isEmpty()) {
mOtherIds.clear();
}
if (null != mOnRetryClickListener) {
mOnRetryClickListener = null;
}
if (null != mViewStatusListener) {
mViewStatusListener = null;
}*/
}```
@printlybyte