Autoresizing issue in Xcode 8

后端 未结 9 1830
无人及你
无人及你 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:58

    Update the issue seems to have been fixed in Xcode 8.1


    Having the same issue and I've found that the offender here is the UIScrollView element. Just move everything outside of your scroller and you will see that everything works just fine, like before.

    Which means one possible workaround would be to place your scrollable content in an ordinary UIView, then replacing it with UIScrollView at run time, programmatically.

    0 讨论(0)
  • 2020-12-05 14:00

    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,

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

    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.

    0 讨论(0)
  • 2020-12-05 14:02

    A moderator kindly deleted my answer here as a duplicate, so see my answer at:

    Autoresizing under iOS 10 doesn't work

    In response to max, yes, resizing a bunch of subviews can be a pain. That's why I suggested adding a single "content view" to the scroll view and moving all of your existing subviews inside of that view. Autosize the subviews inside of the content view just as you did with the scrollview, and autosize the content view to the scrollview.

    It's that content view that you're then resizing inside viewDidLayoutSubviews.

    And again, the "content view" inside of the scrollview construct is pretty much the standard way to get auto-sizing scroll views using autolayout, so it should be considered a best practice.

    That method is described here...

    https://spin.atomicobject.com/2014/03/05/uiscrollview-autolayout-ios/

    My method seems a little convoluted, but I was able to patch up a storyboard with about a dozen scenes and Vc's in about 15 minutes. It would have taken much, much, much longer to rebuild everything using auto layout.

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