Autolayout in iOS 8 produces a different frame than in iOS 7 with the exact same constraints

Originator:michele.titolo
Number:rdar://18320967 Date Originated:9/12/14
Status:Open Resolved:
Product:iOS Product Version:8.0 (12A365)
Classification:Serious Bug Reproducible:Always
 
Summary:
Running the same code in iOS 8 and iOS 7 produces drastically different results. This is independent of device size.

From my playing around, it looks like the issue is when views are nested. Below, you'll see what looks like the parent view's frame being used to set the child view's origin y instead of bounds.

The sample project will log out the constraints, as well as the frames in question. When running on a 4s you'll see these logs:

Version: 7.1
Window Constraints:(
    "<NSLayoutConstraint:0x799292b0 H:|-(0)-[UIView:0x799284c0]   (Names: '|':UIWindow:0x79817240 )>",
    "<NSLayoutConstraint:0x799293c0 H:[UIView:0x799284c0]-(0)-|   (Names: '|':UIWindow:0x79817240 )>",
    "<NSLayoutConstraint:0x79929a10 UIWindow:0x79817240.height == UIView:0x799284c0.height>",
    "<NSLayoutConstraint:0x79929b90 UIWindow:0x79817240.top == UIView:0x799284c0.top>"
)
Window Frame:{{0, 436}, {320, 44}}
Root VC.view Frame:{{0, 0}, {320, 44}}

Version: 8.0
Window Constraints:(
    "<NSLayoutConstraint:0x79f79280 H:|-(0)-[UIView:0x7a881930]   (Names: '|':UIWindow:0x7a886570 )>",
    "<NSLayoutConstraint:0x79f85490 H:[UIView:0x7a881930]-(0)-|   (Names: '|':UIWindow:0x7a886570 )>",
    "<NSLayoutConstraint:0x7a889120 UIWindow:0x7a886570.height == UIView:0x7a881930.height>",
    "<NSLayoutConstraint:0x7a889220 UIWindow:0x7a886570.top == UIView:0x7a881930.top>"
)
Window Frame:{{0, 436}, {320, 44}}
Root VC.view Frame:{{0, 436}, {320, 44}}

Steps to Reproduce:
1. Open and run sample project on iOS 7.1.
2. Tap "Tap Me"
3. Observe view coming up from the bottom.
4. Re-run on iOS 8.
5. Tap "Tap Me"
6. Note lack of view at the bottom.
7. Compare logs from run on iOS 7.1 and iOS 8. The same constraints will have different frames (Root VC.view's origin specifically).

Expected Results:
The same constraints set in ios 7 and ios 8 should result in the same frames.

Actual Results:
The frames are different.

Version:
8.0 (12A365)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!