Android闪退:Most only support three sub view

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kururunga/article/details/85336698

出现的原因是在于smartrefreshlayout嵌套的视图层级超过三层,现在四层

    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.scwang.smartrefresh.layout.header.ClassicsHeader
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
        <com.youth.banner.Banner
            android:id="@+id/home_banner"
            android:layout_width="match_parent"
            android:layout_height="120dp" />
        <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

        <com.scwang.smartrefresh.layout.footer.ClassicsFooter
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

    </com.scwang.smartrefresh.layout.SmartRefreshLayout>

我将banner注释掉后就不会闪退.

猜你喜欢

转载自blog.csdn.net/kururunga/article/details/85336698