正在处理https://github.com/madebybright/Nimble/
尝试在运行查询函数时更改 View 框架大小,但我不断收到
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.
当查询函数运行时。
在 viewDidLoad
中分配大小时一切正常,但在 query
( https://github.com/madebybright/Nimble/blob/unstable/Nimble/MenuViewController.swift#L43 ) 中会引发错误。
知道为什么吗?
最佳答案
是的。这是因为
This application is modifying the autolayout engine from a background thread.
:)
更具体地说,您必须在主线程上完成所有与 UI 相关的工作。您可以使用dispatch_async
在主线程上排队任务(例如帧大小调整)。
关于macos - 更改 View 框架大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32175344/