【发布时间】:2021-11-23 16:11:11
【问题描述】:
[这是我的代码][1]
[1]:https://i.stack.imgur.com/uoq`valrecyclerView = findViewById(R.id.recyclerView) recyclerView.layoutManager=LinearLayoutManager(这个) `xi.png
【问题讨论】:
标签: android android-studio kotlin
[这是我的代码][1]
[1]:https://i.stack.imgur.com/uoq`valrecyclerView = findViewById(R.id.recyclerView) recyclerView.layoutManager=LinearLayoutManager(这个) `xi.png
【问题讨论】:
标签: android android-studio kotlin
您必须推断findViewById 方法的正确类型,否则recyclerview 变量将是通用View 而不是RecyclerView
val recyclerView = findViewById<RecyclerView>(R.id.recyclerView)
【讨论】: