gpt4 book ai didi

iphone - 旋转设备后返回 UITableViewController 时 popViewController 非常慢

转载 作者:行者123 更新时间:2023-11-29 10:59:07 25 4
gpt4 key购买 nike

我有一个主菜单,它是一个 UITableViewController。如果手机处于纵向模式,然后我转到另一个 viewController,然后将手机旋转到横向,然后点击后退按钮返回到 UITableViewController,那么之前会有大约 2 秒的延迟(在 iPhone 5 上)返回。 iPhone 4s 上的延迟约为 4 秒。

更新:探查器显示系统函数 [UITableViewCell setFrame:] 花费了时间。该函数的大部分时间都在 [UIView(AdditionalLayoutSupport) _recursiveLayoutEngineDidChange] 中。

更新 2:更多挖掘表明罪魁祸首是 AutoLayout。关闭 AutoLayout 可以完全解决性能问题。

最佳答案

在 Build -> Profile 中使用 Xcode 的 Time Profiler 查看延迟的原因。它几乎肯定在您编写的某些代码中。教程在这里:http://blancer.com/tutorials/flex/78335/apple-profiling-tools-shark-is-out-instruments-is-in/

关于iphone - 旋转设备后返回 UITableViewController 时 popViewController 非常慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16845261/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com