是否有当自动布局已经完成了火灾的是iOS的方法? [英] Is there an iOS method that fires when Autolayout has completed?

查看:107
本文介绍了是否有当自动布局已经完成了火灾的是iOS的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iOS应用程序中,我需要知道,当一个新的观点是在屏幕上完全可见;也就是说,当自动布局已经完成它的计算和图已完成绘图

I have an iOS app in which I need to know when a new view is completely visible on-screen; that is, when Autolayout has finished its calculations and the view has finished drawing.

ViewDidAppear似乎火以及之前的观点是完全可见。如果我关掉自动布局,时机似乎人类感知去远排队,但我需要使用自动布局在这个项目中(所以这不是一个解决方案...只是一个测试)。

ViewDidAppear seems to fire well before the view is completely visible. If I turn off Autolayout, the timing seems to line up as far as human perception goes, but I need to use Autolayout in this project (so this isn't a solution...just a test).

有没有当自动布局完成计算将触发任何方法?或者说,火灾时的观点实际上是可见的(因为ViewDidAppear不适合此工作)?

Is there any method that fires when Autolayout is done calculating? Or another method that fires when the view is ACTUALLY visible (since ViewDidAppear doesn't work for this)?

谢谢!

推荐答案

我使用viewDidLayoutSubviews这一点。苹果的文件说,调用,以通知其观点,刚刚公布其子视图的视图控制器。

I'm using viewDidLayoutSubviews for this. Apple's documentation says, "Called to notify the view controller that its view has just laid out its subviews."

这篇关于是否有当自动布局已经完成了火灾的是iOS的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆