我已经设置了一个Parse PFTableViewController
,并希望用一些自定义单元格填充表格。
当视图加载时,PFTableView
成功填充了我的自定义单元格类型的单元格,其单元格高度大于默认值44(我为自定义单元格创建了一个类,它是{{ 1}}等等。当我点击一个时,它会将Segue发射到我所做的详细视图中。
BUT!当我点击"<回到"要使用我的所有自定义单元格返回PFTableViewCell
,单元格高度会变回44并且一切都会被压扁!
(我会发布截图,但我还没有足够的声誉)
首次加载PFTableViewController
时,我也会收到以下错误:
PFTableViewController
将尝试通过违反约束来恢复
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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7fc859f82d90 H:[UILabel:0x7fc859f8b930'00%'(48)]>",
"<NSLayoutConstraint:0x7fc859fa95c0 H:[UILabel:0x7fc859fa9350(12)]>",
"<NSLayoutConstraint:0x7fc859faa1e0 H:|-(0)-[UILabel:0x7fc859fa9350] (Names: '|':UITableViewCellContentView:0x7fc859f88bc0 )>",
"<NSLayoutConstraint:0x7fc859faa280 H:[UILabel:0x7fc859fa9350]-(NSSpace(8))-[UILabel:0x7fc859f8bfd0'Course Name']>",
"<NSLayoutConstraint:0x7fc859faa390 UILabel:0x7fc859fa97f0'Course Code'.leading == UILabel:0x7fc859f8bfd0'Course Name'.leading>",
"<NSLayoutConstraint:0x7fc859faa3e0 UILabel:0x7fc859f8b930'00%'.trailing == UITableViewCellContentView:0x7fc859f88bc0.trailingMargin>",
"<NSLayoutConstraint:0x7fc859faa430 H:[UILabel:0x7fc859fa97f0'Course Code']-(NSSpace(8))-[UILabel:0x7fc859f8b930'00%']>",
"<NSLayoutConstraint:0x7fc859fb25c0 'fittingSizeHTarget' H:[UITableViewCellContentView:0x7fc859f88bc0(34)]>"
)
是否有人知道如何解决此问题或可能导致此问题的原因?
注意:我仍然是StackOverflow的新手,所以请告诉我是否还不够清楚:)
答案 0 :(得分:0)
我认为问题很好! 你在用吗?:
func tableView(tableView: UITableView!, heightForRowAtIndexPath indexPath: NSIndexPath!) -> CGFloat {
return yourSpecifiedHeight
}
如果没有,请确保指定以便在表重新加载时使用该值。