如果使用getChildViewHolderInt()方法仍然报错,那么可能是因为该方法是RecyclerView内部使用的方法,不建议在自定义LayoutManager中使用。你可以尝试使用RecyclerView的findContainingViewHolder()方法来获取ViewHolder:
```
override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) {
super.onLayoutChildren(recycler, state)
var totalHeight = 0
for (i in 0 until childCount) {
val child = mRvChat.findContainingViewHolder(getChildAt(i))?.itemView
if (child != null) {
totalHeight += child.height
}
}
if (totalHeight > height) {
mRvChat.postDelayed({ mRvChat.smoothScrollToPosition(itemCount - 1) }, 1000)
}
}
```
这样就可以避免Unresolved reference: getChildViewHolderInt的问题了。