My xib layout likes under drawing I have set the constraints from "a" to "b" to ..."e" besides the height constant of "c" so that can determine the height of the cell. Sometimes the "c" will hidden because some reasons, I changed the height constant to zero and actual height by the label's content when it is visible.
--------------------------------------
UILabel(name-singleline) a
UILabel(title-Multi line) b
UIView(hidden or not) c (default height constant = 80)
-UILabel(content Multi line) d
UILabel(singleline) e
--------------------------------------
But there is a autolayout warning make me crazy
(
"<NSLayoutConstraint:0x15756760 V:[UILabel:0x15756650'XXXX'(15)]>",
"<NSLayoutConstraint:0x15757130 V:[UIView:0x15756ee0(80)]>",
"<NSLayoutConstraint:0x15758060 V:|-(21)-[UILabel:0x15756650'XXXX'] (Names: '|':UITableViewCellContentView:0x157563a0 )>",
"<NSLayoutConstraint:0x15758120 V:[UILabel:0x15756650'XXXX']-(14)-[Project.GWWLabel:0x157573d0'YYYY']>",
"<NSLayoutConstraint:0x157581e0 V:[Project.GWWLabel:0x157573d0'YYYY']-(3)-[UIView:0x15756ee0]>",
"<NSLayoutConstraint:0x15758210 V:[UIView:0x15756ee0]-(8)-[UILabel:0x157569e0'ZZZZ']>",
"<NSLayoutConstraint:0x15758270 V:[UILabel:0x157569e0'ZZZZ']-(18)-| (Names: '|':UITableViewCellContentView:0x157563a0 )>",
"<NSLayoutConstraint:0x1575d760 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x157563a0(139.5)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15757130 V:[UIView:0x15756ee0(80)]>
I'm also deeply interested in understanding why this happens