如何解决“可滚动内容大小歧义"?在Xcode 11(iOS 12,iOS 13)中使用自动布局 [英] How to fix "Scrollable Content Size Ambiguity" in Xcode 11 (iOS 12, iOS 13) using Auto Layout

查看:150
本文介绍了如何解决“可滚动内容大小歧义"?在Xcode 11(iOS 12,iOS 13)中使用自动布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用自动版式时,无法在Xcode 11 beta的视图控制器中设置简单的UIScrollView.我知道必须将滚动视图限制在边缘,然后将滚动视图的宽度和高度设置为等于包含滚动视图的整个视图的宽度和高度.但是,当我尝试设置宽度和高度相等时,我没有选择.

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 then set the scroll view width and height equal to the width and height of the entire view that contains the scroll view. However, I am not getting the option to set equal widths and heights when I attempt to do so.

当我从滚动视图中右键单击并拖动到整个主视图时,我得到以下选项:

When I do the right-click-drag from the scroll view to the entire main view, I get the following options:

  • 通往安全区的领先空间
  • 安全区域的顶部空间
  • 将空间拖到安全区域
  • 底部空间到安全区域
  • 在安全区域中水平居中
  • 在安全区域内垂直居中

在其他视频中,我似乎没有一个等宽"和等高"选项.

In other videos, there is an "Equal Widths" and "Equal Heights" option that I don't seem to have.

我是在做错什么,还是Apple改变了Xcode 11中滚动视图的工作方式?

Am I doing something wrong, or did Apple change the way scroll views work in Xcode 11?

推荐答案

在属性的大小检查器(标尺图标)中禁用内容布局指南

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.

希望有帮助! :)

这篇关于如何解决“可滚动内容大小歧义"?在Xcode 11(iOS 12,iOS 13)中使用自动布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆