Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoresizing issue in Xcode 8

=== EDIT ========

This issue is now solved in Xcode 8.1. I have checked.

================

I don't know auto-layout properly. So, I am using autoresizing option in my all apps and it's fine for me. I am able to fulfill my all requirements by this without any issue.

Now in Xcode 8, I have migrated my old swift project to swift 3. Now issue arises.

Storyboard SS

See in image, I have set Autoresizing, and its working fine without issue in all devices until now and this project is live in AppStore, so that I can't show the UI or storyboard.

Now I have to do some update in project. So I am working in Xcode 8 now. But my autoresizing not working properly, as all the controls are come in center and UI is messed up.

Output image

And the issue persists in device also. I have checked in simulator and device as well. But problem is there also. Any suggestion and help will be appreciated. Thanks in advance.

EDIT:

Yesterday there is issue in runtime only, But Today storyboard also changed views like this image

Storyboard image

Which means the whole UI design is messed up. This is weird.

like image 385
Max Avatar asked Sep 16 '16 07:09

Max


3 Answers

Facing same issue. As a my point of view this problem is occurred when we use autoresizing and set only inner autoresizingMask to any view controller. Like,

enter image description here

If we use also boundary autoresizingMask at that time not facing this issue. Like,

enter image description here

I don't know this is actual bug of xcode 8 or remove this functionality in xcode 8.

So, Finally my suggestion is that we need to use auto layout in xcode 8.

like image 86
Keyur Hirani Avatar answered Nov 03 '22 14:11

Keyur Hirani


Please try to uncheck autoresizing from xib or storyboard. And inviewDidLoad set [_scrollView setAutoresizesSubviews:YES];

Try it if this solve your problem

Edit: In case of storyboard uncheck Resize view from NIB option.

like image 7
Hassy Avatar answered Nov 03 '22 14:11

Hassy


I'm not sure about storyboards but I've found a temporary solution for xib files. In Utilities panel (right hand panel) select File Inspector tab. Under Interface Builder Document section, select the file to open in "XCode 7.x". It will ask you to confirm that you do not want to use XCode 8 features, save the file and close it.

enter image description here

like image 3
Srdr Avatar answered Nov 03 '22 13:11

Srdr