如何在kotlin中的片段中设置recyclerview适配器

时间:2019-12-01 15:03:51

标签: android kotlin android-recyclerview

The below error is displayed.

我正在尝试在Fragment的onViewCreated Lifecycle方法上设置适配器。

2 个答案:

答案 0 :(得分:0)

尝试使用image_recyclerview.adapter = picture_adapter(信息,此,此)

答案 1 :(得分:0)

在kotlin中,您不必使用“ setAdapter”,而是可以只使用适配器。 尝试执行此操作时,请记住这不是函数调用。 相反,您可以像这样使用它:

imageRecyclerView.adapter = picture_Adapter(infos, this, this)

相关问题