![](/img/trans.png)
[英]How can i create a RecyclerView inside of the another recyclerview's item?
[英]How can i create one recyclerview into another recyclerview android
這是我的 json 響應,如何在 android 中使用一個 recyclerview 創建布局到另一個 recyclerview
{
"status": "success",
"message": "Scholarships fetched successfully",
"data": [
{
"scholarship_id": "1",
"scholarship_name": "Test1",
"scholarship_overview": "<p>Test1</p>\n",
"university_details": [
{
"university_name": "Test2",
"country_name": "USA",
"courses": "B.Sc / M.Sc"
}
]
},
{
"scholarship_id": "2",
"scholarship_name": "Test2",
"scholarship_overview": "<p>Test2</p>\n",
"university_details": [
{
"university_name": "Test2",
"country_name": "USA",
"courses": "B.Sc / M.Sc"
},
{
"university_name": "Test3",
"country_name": "Switzerland",
"courses": "B.E. / B.Tech"
}
]
},
我如何創建布局並將其綁定到 recyclerview 中,我希望將數據對象放入 recylerview 並在數據 recyclerview 中將另一個 recyclerview 添加到 android 中的數據 Recyclerview 中。
只需為視圖持有者中的項目添加回收者視圖。
在第一個回收器視圖中,您將實現適配器和視圖持有者,在視圖持有者中添加包含另一個回收者視圖的布局,然后在第一個回收者視圖適配器中處理嵌套的回收者視圖。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.