作者: | 来源:互联网 | 2023-09-12 11:03
Imtryingtoimplementatableviewwithscrollablehorizontalitems(withunknownnumberofitems)
I'm trying to implement a table view with scrollable horizontal items (with unknown number of items) like the illustration below:
我正在尝试使用可滚动的水平项目(项目数量未知)实现一个表视图,如下图所示:
The UI should behave like so:
UI应该这样做:
- At the init state the table cell shows a label and some text and the circle item pops out of the right side
- 在init状态下,表单元格显示一个标签和一些文本,圆圈项从右侧弹出
- If the users swipes from right to left, the label and text fades out and the horizontal list (inside the cell) takes it's place
- 如果用户从右向左滑动,标签和文本就会消失,而水平列表(在单元格内)就会取代它。
I thought about using TableView and dequeueReusableCellWithIdentifier
and creating a prototype cell, but then I need to remember the list horizontal position and init the cell properly on cellForRowAtIndexPath
and that will probably affect performance.
我考虑过使用TableView和dequeueReusableCellWithIdentifier并创建一个原型单元格,然后我需要记住列表水平位置并在cellForRowAtIndexPath上正确初始化单元格,这可能会影响性能。
Q: What layout would you use in order to achieve this goal, any input / tutorial would be appreciated
问:为了达到这个目标,你会使用什么样的布局,任何输入/教程都会受到欢迎
3 个解决方案