Я создаю представление таблицы с помощью AutoLayout
для прошивки 7 - IOS 9.UITableViewCell + AutoLayout Содержание Размера не обновляются
Я создал единый прототип ячейки с .xib интерфейса строителем.
Внутри реализации клеток у меня нет реализации еще.
Несмотря на то, что AutoLayout
ограничения, кажется, при условии правильно, я получении ошибки, как это:
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x7fad5a80c3b0 UILabel:0x7fad585a6c60.width == UILabel:0x7fad5ad9f2b0.width>",
"<NSLayoutConstraint:0x7fad5a84c0a0 UILabel:0x7fad5ad9f2b0.leading == UILabel:0x7fad585a6c60.trailing + 10>",
"<NSLayoutConstraint:0x7fad5862a140 UILabel:0x7fad585a6c60.leading == MyCustomTableViewCell:0x7fad5ad88560.leading + 10>",
"<NSLayoutConstraint:0x7fad58621c30 MyCustomTableViewCell:0x7fad5ad88560.trailing == UILabel:0x7fad5ad9f2b0.trailing + 10>",
"<NSLayoutConstraint:0x7fad5ae218c0 MyCustomTableViewCell:0x7fad5ad88560.width == 1>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fad5a84c0a0 UILabel:0x7fad5ad9f2b0.leading == UILabel:0x7fad585a6c60.trailing + 10>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Когда достигается точка останова, линии [[[0x7fad5ad9f2b0 superview] superview] recursiveDescription]
дисплеи:
<VideoAnalysisVideoInformationTableViewCell: 0x7fad5ad88560; baseClass = UITableViewCell; frame = (0 301; 1 35); autoresize = W; layer = <CALayer: 0x7fad585445a0>>
| <UITableViewCellContentView: 0x7fad585d9d60; frame = (0 0; 1 35); opaque = NO; gestureRecognizers = <NSArray: 0x7fad585a2d30>; layer = <CALayer: 0x7fad585e9b40>>
| | <UILabel: 0x7fad585a6c60; frame = (10 5; 145 25); text = 'Score'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fad5850b030>>
| | <UILabel: 0x7fad5ad9f2b0; frame = (165 5; 145 25); text = '33'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fad5ad98210>>
| <_UITableViewCellSeparatorView: 0x7fad5a8cf620; frame = (15 34; 305 1); layer = <CALayer: 0x7fad5a9121d0>>
кажется , что размер представления содержимого неверен. Как это могло случиться? Как я могу это исправить?
Не устанавливайте размер рамки при использовании AutoLayout. Вы должны установить размер ячейки в вашем представлении контроллера heightForCellAtIndexPath. –
Это была моя первая мысль. Внутри метода правильная рамка ячейки heightForCellAtIndexPath. На контрольной точке UIViewAlertForUnsatisfiableConstraints - нет. –