How to fix “Scrollable Content Size Ambiguity” in Xcode 11 (iOS 12, iOS 13) using Auto Layout

后端 未结 8 1869
独厮守ぢ
独厮守ぢ 2020-12-23 15:49

When using Auto Layout, I am unable to set up a simple UIScrollView in my view controller in Xcode 11 beta. I know that I must constrain the scroll view to the edges, and th

相关标签:
8条回答
  • 2020-12-23 16:30

    Disabling the content layout guides in properties worked for me.

    0 讨论(0)
  • 2020-12-23 16:31

    Xcode 11+, Swift 5.

    I solved my issue, I prepared video and code

    0 讨论(0)
  • 2020-12-23 16:42

    After spending a long time on this scrolling issue in Xcode-11. The conclusion on this issue is you have to choose the scrolling option while adding a new constraint.

    You can refer to the following screenshot to resolve your issue.

    These mentioned solutions worked for me.

    0 讨论(0)
  • 2020-12-23 16:45

    I also encountered this problem (Version 11.0 beta 3 (11M362v)). I solved this problem by first setting the layout in xcode10 and then running it in xcode11. I haven't found any official instructions yet, proving that this is a problem with xcode11, but for now, I guess this is a problem with xcode11 bate.

    0 讨论(0)
  • 2020-12-23 16:48

    Disabling the content layout guides in size inspector (ruler icon) in properties

    I was having the same issue, and by disabling the option it was gone.

    Hope it helps! :)

    0 讨论(0)
  • 2020-12-23 16:48

    Well, I was facing this issue but I have found a solution. Problem is the Safe Area.

    • Embed Scroll view in a UIview.
    • give Top, Bottom, Right and Left 0.
    • now give constraints of scroll view with this view.
    • Add Equal height and width of content view to this View.

    parent view is automatically giving Safe Area. All you have to do is just embed your scroll view in a UIview and then give equal height and equal width of the content view to this view.

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