ignoreView

open fun ignoreView(@NonNull view: View)(source)

Flags a view so that it will not be scrapped or recycled.

Scope of ignoring a child is strictly restricted to position tracking, scrapping and recyling. Methods like removeAndRecycleAllViews will ignore the child whereas removeAllViews or offsetChildrenHorizontal will not ignore the child.

Before this child can be recycled again, you have to call stopIgnoringView.

You can call this method only if your LayoutManger is in onLayout or onScroll callback.

Parameters

view

View to ignore.

See also