简体   繁体   English

可以忽略Xcode中冲突的约束吗?

[英]Is it okay to ignore conflicting constraints in Xcode?

I am working on an app in Xcode and I get a lot of conflicting constraints when I run it in the simulator even though everything looks just fine. 我正在使用Xcode开发一个应用程序,但是即使一切看起来都很好,我在模拟器中运行该应用程序时也会遇到很多冲突的约束。 I've tried to solve every conflict but often ends up screwing up everything. 我试图解决每一个冲突,但常常最终搞砸了一切。

Someone told me that it's okay to ignore them as long as it doesn't affect the app from working. 有人告诉我,可以忽略它们,只要不影响应用程序正常工作即可。 But is it true that I can just ignore it? 但是我真的可以忽略它吗? Will App Store allow me to publish app with tons of conflicting constrains? App Store会允许我发布带有大量冲突约束的应用程序吗?

No, it is not okay. 不,这不好。 It is not specified how the layout engine resolves conflicts (it lists conflicts that it decided to ignore in a particular case in the end of the log message). 未指定布局引擎如何解决冲突(它在日志消息的末尾列出了在特定情况下决定忽略的冲突)。 So even if it works now, on your device with your OS version, there is no guarantee, that it won't brake in future/on some other device. 因此,即使它现在可以正常运行,也不能保证在您使用OS版本的设备上,它不会在将来/在其他设备上停止运行。 It will most likely work, but there is no guarantee, so it's not safe. 它很可能会工作,但不能保证,因此不安全。

The AppStore review team will allow your app to the AppStore though. 不过,AppStore审核小组将允许您的应用程序进入AppStore。 If they won't encounter some terrible UI-related bugs due to broken constraints working differently on their side, I mean. 如果他们不会因为破坏性约束在他们这边工作而遇到一些与UI相关的可怕错误,那是我的意思。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM