UINavigationItem.prompt 出现,将视图移动到下面。如何收听新提示?
我有一个普通的 UINavigationController ,其中包含 UIViewController ,当我的视图控制器应用了提示(通过 UINavigationItem.prompt = @"some Prompt" )时,提示将 UIViewController 的视图向下动画化。
我的问题是,是否有一个苹果程序可以发现会出现提示(也许会出现动画时间),以便我可以重新布局视图?例如:这样内容就显得不动了。或者我必须自己编写这个功能。我真正想要的是类似于 KeyboardWillShow/Hide 通知的通知。
请注意,控制器不是应用提示的对象,提示将异步出现和消失。不是寻找代码,只是建议。
I have a normal UINavigationController with a UIViewController contained in it, when my view controller has a prompt applied to it (via a UINavigationItem.prompt = @"some prompt"), the prompt is animating the UIViewController's view downward.
My question is, is there an apple what to find out that a prompt will appear (and maybe the animation time it will take) so I can relayout the view? For example: so the content appears not to move. Or do I have to write this functionality myself. What i am really looking for is a notification similar to the KeyboardWillShow/Hide notifications.
Note that the controller is not the object applying the prompt, and the prompt will appear and disappear asynchronously. Not looking for code, just advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当值发生变化时,您始终可以使用 kvo 来获取回调。至于所花费的时间,可能只是默认值(0.25 秒),也可能使用 UINavigationControllerHideShowBarDuration 常量。我想在处理这个动画时你真的只需要让它“足够接近”。
You can always use kvo to get a callback whenever the value changes. As for the time taken, it may be just the default (0.25 seconds) or it may use the
UINavigationControllerHideShowBarDuration
constant. I imagine that you really only need to get it "close enough" when dealing with this animation.