I am trying to add UITextFields to the contentViews of some static UITableViewCells. If I just add them directly to the cells in the storyboard, I get several of the following warning in Xcode 5:
Ambiguous Layout: Position is ambiguous for "Round Style Text Field".
If I then select the UITextFields and choose "Add Missing Constraints" in the storyboard, I then get this warning instead:
Misplaced View: Frame for "Round Style Text Field" will be different at run time.
In addition, I've tried adding constraints between the UITextField and the the contentView manually (by selecting those two views and trying to add a constraint), but it seems like none of the constraint options are available for that particular relationship (checkboxes are all disabled)
Here are some screenshots of the Storyboard:
In the view controller panel to the left of storyboard there will be a yellow circle with an arrow Arrow, click it.
Then in the new panel click the yellow triangle with a circle in the middle.
You should get three options:
In your case update constraints should work
I was having similar issues - unable to add ("Pin") constraints to the embedded UITextField, getting warnings about it, etc. The OP didn't specify, but from the screenshot it appears the static UITableViewCell's Style is set to one of the pre-defined types ("Left Detail", in particular).
I found that setting the Table View Cell "Style" dropdown to "Custom" will magically enable adding constraints to the UITextField, at the cost of having to re-build the pre-defined cell style yourself - e.g. adding the UILabel(s) and matching their alignment to the other cells.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With