Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

然后在fragment应用 外层是viewpager+tablayout 滑动几次就会空白 #41

Open
printlybyte opened this issue Dec 20, 2019 · 2 comments

Comments

@printlybyte
Copy link

MultipleStatusView 嵌套TwinklingRefreshLayout



<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 滑动几次就会空白

@Anima18
Copy link

Anima18 commented Jan 8, 2020

遇到同样问题,层主解决了吗

@Anima18
Copy link

Anima18 commented Jan 9, 2020

问题解决了,看了源码,在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 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants