问题列表箭头UITableView Swift UIKit

huangapple go评论49阅读模式
英文:

A problem with a list-arrow UITableView Swift UIKit

问题

我有一个关于列表箭头的问题。当列表关闭时,箭头指向右边。当我们分别打开它们时,箭头会指向上。但如果你滚动页面到底部然后返回到开头,箭头会在不同方向上已经指向右边。有什么想法为什么会这样?

英文:

I have a problem with the lists arrow. The arrows point to the right when the lists are closed. When we open respectively up. But if you scroll the page to the bottom and return to the beginning, the arrows will already be to the right in different directions. Any ideas why?

问题列表箭头UITableView Swift UIKit

答案1

得分: 1

因为UITableView会重用TableViewCell,当你再次滚动时,它会将它们重新生成为默认状态!所以你需要在你的Model类中保存状态,并重新分配先前的状态。

英文:

Because UITableView reuses TableViewCell, it regenerates them to the default when you scroll again! so you need to save the state in your Model class and reassign the previous state

huangapple
  • 本文由 发表于 2023年2月24日 00:30:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/75547653.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定