{"record":{"id":"6809f4c18532a982","repo":"Tencent/QMUI_Android","slug":"the-view-create-by-oncreatecontentview-should-im","errorCode":null,"errorMessage":"the view create by onCreateContentView() should implement from IQMUIContinuousNestedBottomView","messagePattern":"the view create by onCreateContentView\\(\\) should implement from IQMUIContinuousNestedBottomView","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"qmui/src/main/java/com/qmuiteam/qmui/nestedScroll/QMUIContinuousNestedBottomDelegateLayout.java","lineNumber":96,"sourceCode":"    public QMUIContinuousNestedBottomDelegateLayout(Context context) {\n        this(context, null);\n    }\n\n    public QMUIContinuousNestedBottomDelegateLayout(Context context, AttributeSet attrs) {\n        this(context, null, 0);\n    }\n\n    public QMUIContinuousNestedBottomDelegateLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n\n        mParentHelper = new NestedScrollingParentHelper(this);\n        mChildHelper = new NestedScrollingChildHelper(this);\n\n        ViewCompat.setNestedScrollingEnabled(this, true);\n        mHeaderView = onCreateHeaderView();\n        mContentView = onCreateContentView();\n        if (!(mContentView instanceof IQMUIContinuousNestedBottomView)) {\n            throw new IllegalStateException(\"the view create by onCreateContentView() \" +\n                    \"should implement from IQMUIContinuousNestedBottomView\");\n        }\n        addView(mHeaderView, new FrameLayout.LayoutParams(\n                ViewGroup.LayoutParams.MATCH_PARENT, getHeaderHeightLayoutParam()));\n        addView(mContentView, new FrameLayout.LayoutParams(\n                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));\n        mHeaderViewOffsetHelper = new QMUIViewOffsetHelper(mHeaderView);\n        mContentViewOffsetHelper = new QMUIViewOffsetHelper(mContentView);\n        mViewFlinger = new ViewFlinger();\n    }\n\n    public View getHeaderView() {\n        return mHeaderView;\n    }\n\n    public View getContentView() {\n        return mContentView;\n    }","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/Tencent/QMUI_Android/blob/026e7d486677d6593a96689cd590ec3561176717/qmui/src/main/java/com/qmuiteam/qmui/nestedScroll/QMUIContinuousNestedBottomDelegateLayout.java#L78-L114","documentation":"QMUIContinuousNestedBottomDelegateLayout's constructor calls onCreateContentView() and requires the returned View to implement IQMUIContinuousNestedBottomView, since the layout delegates nested scrolling calls to that interface. If it does not, an IllegalStateException is thrown during construction.","triggerScenarios":"Subclassing QMUIContinuousNestedBottomDelegateLayout and overriding onCreateContentView() to return a View (e.g. plain RecyclerView, WebView, LinearLayout) that does not implement IQMUIContinuousNestedBottomView.","commonSituations":"Returning a raw RecyclerView instead of the library's QMUIContinuousNestedBottomRecyclerView; custom content views written before reading the interface contract; copy-paste from the header-side subclass where no such interface is required.","solutions":["Return a view implementing IQMUIContinuousNestedBottomView, such as QMUIContinuousNestedBottomRecyclerView.","Wrap your custom view in a class implementing IQMUIContinuousNestedBottomView and forward its methods.","If a plain scrollable is needed, use the library-provided bottom view subclasses."],"exampleFix":"// before\noverride fun onCreateContentView(): View = RecyclerView(context) // throws\n// after\noverride fun onCreateContentView(): View = QMUIContinuousNestedBottomRecyclerView(context)","handlingStrategy":"validation","validationCode":"override fun onCreateContentView(): View {\n  val v = ... // your view\n  require(v is IQMUIContinuousNestedBottomView) { \"content view must implement IQMUIContinuousNestedBottomView\" }\n  return v\n}","typeGuard":"fun View?.isContinuousNestedBottom(): Boolean = this is IQMUIContinuousNestedBottomView","tryCatchPattern":null,"preventionTips":["Return QMUIContinuousNestedBottomRecyclerView or another IQMUIContinuousNestedBottomView implementation","Add an assertion in onCreateContentView during development","Do not copy header-side overrides where the interface is not required"],"tags":["android","nested-scroll","layout","type-mismatch","illegalstate"],"backgroundTag":"incompatible-source-type","analyzedSha":"026e7d486677d6593a96689cd590ec3561176717","analyzedAt":"2026-09-06T13:32:24.816Z","contentChangedAt":"2026-09-06T13:32:24.816Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}