私は少しイライラしています。セルを含むiOS 10 プロジェクトUITableView
があります。UITableViewAutomaticDimension
制約を適切に設定します。
最初は、セルを内部にマッピングしていました
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
すべてが正常に機能していましたが、記事を読みました: https://medium.com/ios-os-x-development/perfect-smooth-scrolling-in-uitableviews-fd609d5275a5#.4rnbc4vygデータマッピングを
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath)
この後、自動レイアウトセルが正しく機能しなくなりました。
cellForRowAt
at height は after but beforeを計算していることを理解しているため、高さでwillDisplay
マッピングしているときはwillDisplay
、セルに既に設定されており、再度リロードする必要があります (これは良くありません)。
誰でもこれを証明/説明できますか?
アップデート:
質問を投稿した後、次の記事を見つけました: https://tech.zalando.com/blog/proper-use-of-cellforrowatindexpath-and-willdisplaycell/