Correction limit does not work properly on Xcode 9

I try to set the โ€œ0โ€ limit on the UIImageView from the sides (left and right), but when I add the โ€œMargin Restrictionโ€ restriction, it captures the image to the edge from the ViewController while it should remain at some distance, why is this happening?

+14
swift uiimageview xcode9
source share
3 answers

I had the same problem and recently solved the problem by disabling the safe zone. Secure area configuration is enabled by default. To disable safe area configuration in Xcode 9, choose View> Utilities> Show Inspector File and uncheck Use Safe Area Layout Guides. This should fix the problem. Good luck, hope this helps.

+29
source share

Make sure your UIImageView overlaps or fits beyond that border. If so, then the tagging restriction does nothing. What I did to fix this was to manually move this object so that it was far from the field line and try again.

This allows you to maintain a safe area.

+1
source share

I found that if the UIView overlaps or another view, this problem also occurs - for example, if you want to put the image side by side, and you also have a full-screen preview of the camera.

For me, the solution was to drag the view where I wanted (that is, one way), and then set the restrictions, and since then it behaved correctly - I did not have to delete the safe view. This is with Xcode 10.1.

0
source share

All Articles