【发布时间】:2018-01-19 11:26:09
【问题描述】:
我有以下json数据
{
"Display_Selected List":
[
{
"product_name": "Product1",
"items":
[
{
"item_name": "SubItem1",
"specifications":
[
{
"list": [
{
"name": "Sp1"
},
{
"name": "Sp2"
}
],
"specification_name": "Specification Group 1"
},
{
"list": [
{
"name": "Sp3"
},
{
"name": "Sp4"
}
],
"specification_name": "Specification Group 2"
}
]
},
{
"item_name": "Sub Item2",
"specifications":
[
{
"list": [
{
"name": "Sp2"
}
],
"specification_name": "Specification Group 1"
},
{
"list": [
{
"name": "Sp3"
}
],
"specification_name": "Specification Group 2"
}
]
}
]
},
{
"product_name": "Product2",
"items":
[
{
"item_name": "Item1",
"specifications":
[
{
"list": [
{
"name": "Sp3"
},
{
"name": "Sp4"
}
],
"specification_name": "Specification Group 2"
}
]
}
]
}
]
}
根据设计要求,我必须在单个 uitable 视图中显示整个数据,如下所示 我创建了如下图所示的粗略设计
我可以通过
uitableview在uitableviewcell中实现这一点,但作为 根据 Apple 的建议 Apple 不建议使用表视图 添加为其他可滚动对象的子视图
现在我的问题是如何通过单个 uitableview 实现以下设计,并且根据我的 json,所有内容都是动态的
有没有人见过这样的东西?任何参考都会有所帮助。
【问题讨论】:
-
如果每次都显示项目名称,您可以对产品使用 headerview,然后您还可以在 header..for 项目和规格组中添加您使用本教程 sapandiwakar.in/nested-sections-in-uitableview
-
没有我的产品应该是 sectionHeader 因为有多个产品数组显示 Product>Item>Specification>List
-
是每次都显示产品和项目?
-
但是如果 item 没有任何规范,那么它的数组就像这个 Product>item-second item
-
根据教程有体育>蝙蝠和球>棒球,但我有 4 个级别
标签: ios swift uitableview sections