I'm working with Auto Layout Visual Format Language and using the following expressions:
- H:|[_tableView]|
- H:|[_actionButton]|
- V:|[_tableView][_actionButton(==buttonHeight)]|
They work fine in 9 and 10, but in iOS 8.1 we noticed that the layout is not working as expected. The view is getting the double of dimensions.
- For iOS 10
<UIWindow: frame = (0 0; 320 568);><UIView: frame = (0 0; 320 568);For iOS 8.1
<UIWindow: frame = (0 0; 320 568);><UIView: frame = (0 0; 640 1136);>
The testing code im using:
- ViewController - http://pastebin.com/PjQpKJBD
- AppDelegate.m - http://pastebin.com/4iri9Yp5
Thanks in advance
This bug appears to be caused in your app delegate, by initializing the window and calling
makeKeyAndVisiblebefore it has a frame. Replace this line:With an explicit frame on initialization:
...and remove the redundant line setting the window's frame afterwards. Alternatively you could move the call to
makeKeyAndVisibleafter the setting the window's frame, ie:Either way should work.