Mansory set the cell child control to open the cell contentview from top to bottom, the calculation can automatically calculate the height, but iOS7 will report the following warning
Probably at least one of the constraints in the following list are one you don ' t want. Try this: (1) Look at the 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 so you don ' t understand, refer to the documentation for the UIView Property translatesautoresizingmaskintoconstraints)
(
"<maslayoutconstraint:0x179e9210 uilabel:0x1673d3d0.height = = 14.316>",
"<maslayoutconstraint:0x1670dd90 uilabel:0x1673d3d0.top = = uitableviewcellcontentview:0x179d32e0.top>",
"<maslayoutconstraint:0x1798e460 Uiview:0x179df8e0.top = = Uilabel:0x1673d3d0.bottom + 10>",
"<maslayoutconstraint:0x179d57b0 Uiview:0x179df8e0.bottom = = uitableviewcellcontentview:0x179d32e0.bottom-25 > ",
"<nsautoresizingmasklayoutconstraint:0x178c4980 uitableviewcellcontentview:0x179d32e0.height = = 44>"
)
The last word is that the original 44 default constraints and some existing conflicts, the solution is
- (Id)Initwithstyle:(Uitableviewcellstyle)Style Reuseidentifier:(NSString *)Reuseidentifier{ Self = [SuperInitwithstyle:UitableviewcellstyledefaultReuseidentifier:Reuseidentifier]; If (Self) { Selfcontentview.= uiviewautoresizingflexibleheight| uiviewautoresizingflexiblewidth;//** This sentence is important [self Createsubviews]; } return self;}
http://stackoverflow.com/questions/19132908/ Auto-layout-constraints-issue-on-ios7-in-uitableviewcell
Use Mansard to set constraints on the child controls of the cell, and automatically calculate the cell height problem, iOS7 warning