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

查看:26
本文介绍了如何修复“可滚动内容大小歧义"在 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 the size inspector (ruler icon) in properties

我遇到了同样的问题,禁用该选项后它就消失了.

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

希望对您有所帮助!:)

Hope it helps! :)

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

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