Authorization does not work in iOS11 / Xcode 9

It appears that Autoresizing views no longer works reliably when created for iOS11 with Xcode 9.

The layout of several views ends with the positioning of the controls as they are in the XIB, but there has been no corresponding resizing. This works great in iOS10 and works with our old app running on iOS11. However, when restoring the application, the positioning and calibration failed.

autoresizingmask something changed that affects the use of autoresizingmask ?

Is there a way to automatically convert from Autoresizing to AutoLayout and Constraints ?

Edit: The controls that pose the problems are UINavigationBar and UIToolBar .

+7
autolayout ios11 xcode9 autoresizingmask ios-autolayout
source share
2 answers

I am working on the same problem today: one thing that worked in some cases is the replacement for similar (but not identical) mask values. For example, one of our views did not work with UIViewAutoresizingFlexibleHeight, but it works with UIViewAutoresizingFlexibleBottomMargin.

I am not aware of the automatic way to upgrade to AutoLayout - I really use AutoLayout a lot in other projects, and the conceptual framework is pretty different ...

I will edit this answer if I find anything better.

+2
source share

Same problem. As already mentioned, @John Nimis, playing with masks, somehow seems to solve the problem. For example, when we had both upper and lower masks (UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin), we got success by removing the top one.

EDIT I do not know if this is the final solution, but I noticed that there was a problem everywhere. I had a fixed origin (x or y) on the frame. For example:

view.frame = (view1.frame.origin.x, 150, width, height);

Changing a fixed value in a relative value (for example, in relation to another view1) solved the problem with masks:

view.frame = (view1.frame.origin.x, view1.frame.origin.y + view1.frame.size.height + 20, width, height);

+2
source share

All Articles