Autoresizing issue in Xcode 8

19,435

Solution 1

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.

Solution 2

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.

Solution 3

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

Solution 4

Xcode 8 beta 2 solved this problem!! I already checkeded now!

Solution 5

i also face same issue for scrollView in Xcode8

i have a one solution to work with scrollView

first take a simple UIView and add all component which you want add to in scrollView and give that component to autoSizing

and also take one scrollView and programatically set view frame and also set scrollView contentSize and add your view into scrollView

like wise, in my case i add this code in viewDidLoad for swift project

// add view to scrollview

self.scrollObjForNextAppointment.contentSize = CGSize(width:self.scrollObjForNextAppointment.frame.size.width,height:410)

self.viewForScrollContent.frame = CGRect(x:0,y:0,width:self.scrollObjForNextAppointment.frame.size.width,height:410)

self.scrollObjForNextAppointment.addSubview(self.viewForScrollContent)

it's work for me, Thanks!

Share:
19,435
Max
Author by

Max

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

Updated on June 03, 2022

Comments

  • Max
    Max about 2 years

    === 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.