私はそのような制約のある単一の画像ビューを含むセルを持っています:
left - 12
top - 12
right - 12
height - 300
viewDidLoadで、次のように設定します。
tableView.estimatedRowHeight = 80
tableView.rowHeight = UITableViewAutomaticDimension
ただし、テーブルが読み込まれると、そのセルの高さは約40ポイントになり、ログに次のように表示されます。
Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.
cellForRow ..で画像をURLで設定します。
あなたもこれが必要です。
bottom - 12
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加