📜  在片段中添加 recyclerview - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:10.876000             🧑  作者: Mango

代码示例1
recyclerView1.apply {
            // set a LinearLayoutManager to handle Android
            // RecyclerView behavior
            layoutManager = LinearLayoutManager(activity)
            // set the custom adapter to the RecyclerView
            val notificationobjects : MutableList = mutableListOf()
            notificationobjects.add(Notification("Zainab Al Khalifa", "Grade-I"))
             recyclerView1.adapter = NotificationAdapter(notificationobjects)

        }