Auto Layout + Scaled Views

Prior to iOS 8, Auto Layout used the converted dimensions of the scaled view and took that into account when planning. So, let's say you have a 0.5x transform in the view, and set this view to use the same dimensions as the other, unscaled view. Auto Layout saves these views in the same size. Good oh:

iOS 7 behavior

Since iOS 8, however, Auto Layout now ignores transformed measurements, which means that it implements the layout on a non-transformed coordinate system and makes the material unusual - now, with reduced views, I have masses of spaces:

iOS 8 behavior

So, I wonder if anyone has any ideas on how to bring this original behavior back? I would like to override alignmentRectForFrame: and frameForAlignmentRect: and provide the converted values ​​there, but they are never called.

Has anyone got anything else?

Hurrah!

(For reference, here is a small Xcode project demonstrating the problem )

+5
source share

Source: https://habr.com/ru/post/1215425/


All Articles