Open bernikovich opened 5 years ago
Hey @bernikowich
First of all, let's make sure that this is not a problem with TableKit
itself. Do you have this warning with regular UITableView setup (without TableKit)?
I setup cells like subview.top == cell.contentView.top, subview.bottom == cell.contentView.bottom.
Are you sure that you have all required constraints? What about leading/trailing (left/right) constraints?
@maxsokolov Looks like I found where my issue comes from. I should say I create UI in code. So I implemented such controller in the demo project. In this case if minimum height of cell is more then 44 OS prints warning logs. Steps:
subview.top = contentView.top + 25
and subview.bottom = contentView.bottom - 25
.estimatedHeight
for cell 100
- it should be enough since 25+25=50<<<100.TableDirector
receives cell with height 44 for the first time.
layoutIfNeeded
called we have constraint for height equal to 44, while it cannot be satisfied because our minimum height for contentView
is 50.Screenshot I attached previously is incorrect. I should attach screenshot from TablePrototypeCellHeightCalculator
. When TablePrototypeCellHeightCalculator
dequeues cell it has default height. For cells created in code it's 44.
Looks like it related more to UIKit itself. I don't know why UITableView dequeues cell for indexPath with 44pt height and not estimated height. When you use IB it creates cells with bigger size.
Hello. How should I implement constraints to get rid of these warnings. I see it comes when table view requests cells for index path:
I setup cells like subview.top == cell.contentView.top, subview.bottom == cell.contentView.bottom.