Xcode 愚蠢的警告:视图正在剪辑其内容

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8597189/
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-14 22:48:29  来源:igfitidea点击:

Xcode stupid warning: View is clipping its content

xcodecocoa-touchcocoainterface-builderwarnings

提问by Oneiros


I get this stupid warning in Xcode 4


我在 Xcode 4 中收到了这个愚蠢的警告

Clipped Content
View is clipping its content

if I create an unbordered bevel button with an image bigger then the button itself.
Why? How can i suppress it?

如果我创建一个无边框的斜角按钮,其图像比按钮本身大。
为什么?我怎样才能抑制它?

回答by hailuodev

I had a similar problem with a gray warning.

我遇到了类似的灰色警告问题。

"Warning: Clipped Content. View is clipping its content in XXXX.xib"

“警告:剪辑的内容。视图正在剪辑它的内容 XXXX.xib

I got rid of the warning by right clicking on XXXX.xib> Open As> Source Code.

我被右击摆脱警告XXXX.xib> Open As> Source Code

After building again in xcode the warning was gone.

在 xcode 中再次构建后,警告消失了。

回答by Solid Soft

enter image description here

enter image description here

Change scaling according to your requirement. It will solve it.

根据您的要求更改缩放比例。它会解决它。

回答by Mike K

as far as i know you can't suppress specific xib notices, but you can disable them in general. in project->settings (or target->settings if you have multiple targets and only want to do it for one/some), there is the "Interface Builder XIB Compiler - Options" section which includes "Show Notices". if you set this to No then you should stop seeing this message. of course, it may mean you miss out on other messages.

据我所知,您无法抑制特定的 xib 通知,但您可以在一般情况下禁用它们。在项目->设置(或目标->设置,如果您有多个目标并且只想为一个/某些目标执行此操作),有“Interface Builder XIB Compiler - Options”部分,其中包括“Show Notices”。如果您将此设置为否,那么您应该不会再看到此消息。当然,这可能意味着您错过了其他消息。

回答by Erik

I had the same problem and I finally ended up resizing the image because it was so annoying.

我遇到了同样的问题,最终我调整了图像大小,因为它太烦人了。

回答by user767644

Had the same problem. Nothing helps, but add the complaining NSButton again, same wires and bindings and image in same size (scaling down), problem was gone.

有同样的问题。没有任何帮助,但是再次添加抱怨的 NSButton,相同的电线和绑定以及相同大小的图像(按比例缩小),问题消失了。

回答by neowinston

For Xcode 10.2.1 what solved my problem was to choose Position Below, on Interface Builder, as shown in these pictures, under Show the Attributes inspector tab:

对于 Xcode 10.2.1,解决我的问题的方法是在界面生成器上选择位置下方,如下图所示,在显示属性检查器选项卡下:

enter image description here

enter image description here

enter image description here

enter image description here