iOS 由UITableViewAutomaticDimension引起的autolayout debug

由於 在作UITableViewAutomaticDimension時候,cell自適應,複用出線了佈局問題。佈局

self.tableView.rowHeight = UITableViewAutomaticDimension;

self.tableView.estimatedRowHeight = 100;

通常狀況下 只要是設置了這兩行代碼的話,若是再有複用致使佈局出線問題。應該就是cell的約束的問題。調試

檢查cell是否從上到下加好約束了,即top,bottom。而後在看一下約束之間是否衝突。尤爲是關於cell的top以及bottom。code

下面總結一下關於 約束的調試。cmd

1. Open the Breakpoint Navigator cmd+7
2. Click the Add button in the lower left
3. Select Add Symbolic Breakpoint...
4. Where it says Symbol just type in UIViewAlertForUnsatisfiableConstraintsit

print window autolayout:
po [[UIWindow keyWindow] _autolayoutTrace]io

相關文章
相關標籤/搜索