Xcode“适合内容的大小”已禁用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18033117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:39:16  来源:igfitidea点击:

Xcode "Size to fit contents" disabled

iosxcoderesize

提问by MarkB

Hey guys I'm following the Stanford lectures on developing apps for iOS and I've run into a bit of a problem. The lecturer says to click on a label from the Document Outline and then go to Editor > Size to fit contents in order to remove the fixed size constraints. However my problem is that "Size to fit contents" is disabled and I cannot click it (see image).

大家好,我正在听斯坦福关于为 iOS 开发应用程序的讲座,但遇到了一些问题。讲师说单击“文档大纲”中的标签,然后转到“编辑器”>“大小”以适应内容,以删除固定大小限制。但是我的问题是“适合内容的大小”被禁用,我无法点击它(见图)。

disabled size to fit contents

禁用大小以适应内容

Any idea what I'm doing wrong?

知道我做错了什么吗?

回答by MarkB

I fixed the issue by dragging around the labels and resizing them (randomly) manually and then the option was enabled!

我通过在标签周围拖动并手动调整它们(随机)大小来解决这个问题,然后启用了该选项!

回答by CodenameDuchess

OK this is one that has bugged me for a while. But I finally figured out that if you tap one of the corner handles of the label (you will briefly see a diagonal line mouse icon for resizing) then the "size to fit contents" option is re-enabled.

好的,这是困扰我一段时间的问题。但我终于发现,如果您点击标签的一个角手柄(您将短暂地看到一个用于调整大小的对角线鼠标图标),那么“大小以适应内容”选项将重新启用。

This also works for getting the "horizontal rule" and "vertical rule" options back if you tap on one of the corner handles of a view.

如果您点击视图的一个角手柄,这也适用于恢复“水平规则”和“垂直规则”选项。