Autoresizing issue in Xcode 8

后端 未结 9 1829
无人及你
无人及你 2020-12-05 13:24

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

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

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

I don\'t know auto-layout

相关标签:
9条回答
  • 2020-12-05 13:40

    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.

    0 讨论(0)
  • 2020-12-05 13:42

    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!

    0 讨论(0)
  • 2020-12-05 13:55

    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.

    0 讨论(0)
  • 2020-12-05 13:55

    Apple just came out with XCode 8.2, which fixes this problem for me. I have been using XCode 7.3.1 for my interface design parallel to 8.1, but I can now use 8.2 without any problems.

    The storyboard gets updated with widths and height of frames though, to accommodate the new 'View as:' functionality. Though it doesn't seem to affect running on device/simulator.

    Curiously, the bugfix it is not noted in the XCode 8.2 release notes.

    Original answer here

    0 讨论(0)
  • 2020-12-05 13:57

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

    0 讨论(0)
  • 2020-12-05 13:58

    Solved by unchecking "Auto Resize Subviews" to ScrollView

    0 讨论(0)
提交回复
热议问题