I am working on a project that we tested on iOS 8 devices for several weeks. Today I decided to test it on iOS 7.1 Simulator, and my application registered a shameful constraint error:
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)
I know about the automatic layout, and it is almost impossible to demonstrate a sample (I would have to place almost the entire project here, since there are many views that make a custom drawing, many restrictions associated with other views, etc.). On iOS 8, everything is fine. On iOS 7, some of my views only have zero width / height (debugging them), and some others with the appropriate width / height for these views draw fine. One thing I know is that I double-checked that there are no restrictions related to container fields . I know this is new in iOS 8. Why could there be another reason? Here is the complete trace if this helps:
(
"<NSLayoutConstraint:0x7a0e86b0 H:|-(0)-[UIView:0x7a17dfe0] (Names: '|':UIView:0x7a0e7a40 )>",
"<NSLayoutConstraint:0x7a0e86e0 H:[UIView:0x7a17dfe0]-(0)-| (Names: '|':UIView:0x7a0e7a40 )>",
"<NSAutoresizingMaskLayoutConstraint:0x79ecc850 h=--& v=--& H:[UIView:0x7a0e7a40(320)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7a00add0 h=-&- v=-&- UITransitionView:0x79f9c110.width == UILayoutContainerView:0x79f9c070.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7a00a550 h=-&- v=-&- UILayoutContainerView:0x79f9c070.width == UIViewControllerWrapperView:0x7a1b0340.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7a009840 h=-&- v=-&- UIViewControllerWrapperView:0x7a1b0340.width == UINavigationTransitionView:0x7a18cfd0.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7a008cc0 h=-&- v=-&- UINavigationTransitionView:0x7a18cfd0.width == UILayoutContainerView:0x7a0f17b0.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7a008160 h=-&- v=-&- UILayoutContainerView:0x7a0f17b0.width == UIView:0x7a17dfe0.width>",
"<NSLayoutConstraint:0x7cdcc000 MyAppMoodTypeSelectionView:0x7f19ddf0.width == 2.5*MyAppFaceView:0x7f19e8b0.width>",
"<NSLayoutConstraint:0x7cde0380 MyAppMoodTypeSelectionView:0x7f19ddf0.width == 0.75*UIView:0x7cddfcf0.width>",
"<NSLayoutConstraint:0x7cde0470 MyAppRoundView:0x7a005e00.width == MyAppFaceView:0x7f19e8b0.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7f1a0a20 h=-&- v=-&- UIView:0x7cddfcf0.width == UIViewControllerWrapperView:0x7cde15c0.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7f1a10d0 h=-&- v=-&- UIViewControllerWrapperView:0x7cde15c0.width == UINavigationTransitionView:0x7cdd93a0.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7f1a1750 h=-&- v=-&- UINavigationTransitionView:0x7cdd93a0.width == UILayoutContainerView:0x7a053c60.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7f1a1e90 h=-&- v=-&- UILayoutContainerView:0x7a053c60.width == UIViewControllerWrapperView:0x7cdddc10.width>",
"<NSAutoresizingMaskLayoutConstraint:0x7f1a25e0 h=-&- v=-&- UIViewControllerWrapperView:0x7cdddc10.width == UITransitionView:0x79f9c110.width>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7cdcc000 MyAppMoodTypeSelectionView:0x7f19ddf0.width == 2.5*MyAppFaceView:0x7f19e8b0.width>
, iOS 8.1, , . iOS 7.1 .
translatesAutoresizingMaskIntoConstraints ( , ).
? iOS 7 iOS 8 , ?
UPDATE: . -, iOS 8 , iOS 7 . , .