recyclerview嵌套recyclerview,都是纵向的时候,有可能会出现子recyclerview只显示一条,其他的都显示空白的情况,解决办法:
//父recyclerview
override fun onCreateViewHolder(p0:ViewGroup, p1:Int):ViewHolder {
return ViewHolder(layoutInflater.inflate(R.layout.xxx, p0,false))
}
//子recyclerview
override fun onCreateViewHolder(p0:ViewGroup, p1:Int):ViewHolder {
return ViewHolder(layoutInflater.inflate(R.layout.xxx2, null))
}
网友评论