I have a cell in a tableview which contains UITextView. UITextview has a constraints of top, leading, trailing and bottom to the uitableviewcell content view. I want to hide the uitableviewcell if a textview contains empty text. For that, i reduce cell height to 0. Since the textview has constraint set with respect to UITableViewCell.
UITableViewCell
---------------------------
| -T- |
| -L- UITextView -R- |
|_________-B-_____________|
L,T,B,R - Left, Top, Bottom, Right Constraints
i am getting the constraints issue.
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:0x7fe5d58753a0 UITableViewCellContentView:0x7fe5d5874fe0.bottomMargin == UITextView:0x7fe5d399c000.bottom>",
"<NSLayoutConstraint:0x7fe5d58753f0 UITableViewCellContentView:0x7fe5d5874fe0.topMargin == UITextView:0x7fe5d399c000.top>",
"<NSLayoutConstraint:0x7fe5d5888a20 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7fe5d5874fe0(0.5)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fe5d58753a0 UITableViewCellContentView:0x7fe5d5874fe0.bottomMargin == UITextView:0x7fe5d399c000.bottom>
How can i hide the cell without having any issue with autolayout.