如何将 UIToolbar 与其父视图一起转换
如何从一个 UIViewController (带底部工具栏)过渡到另一个 UIViewController (不带工具栏),以便在动画进行时,工具栏随第一个视图移开,这意味着工具栏保持在第一个视图的初始位置看法?
我在“Things”应用程序中看到过这种行为。
需要明确的是,我并不是在寻找诸如隐藏/显示 viewDidAppear 内的工具栏之类的解决方案。
How can I transition from one UIViewController (with bottom toolbar) to another one (without toolbar), so that while the animation is in progress, the toolbar moves away with the first view, meaning that the toolbar stays in it's initial position of the first view?
I've seen this behaviour in "Things" app.
Just to be clear, I am not looking for solutions such as hiding/showing the toolbar inside viewDidAppear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所以,这是一个我不太满意的解决方案,但目前它似乎是唯一的解决方案。
重点是忽略 UINavigationController 的内置工具栏属性,创建单独的 UIToolbar 并将其放置在视图控制器中。
这样,工具栏将随其视图滑走,不会导致动画问题,例如“白色矩形”或放置在 viewDidAppear 中时迟到出现的工具栏...
So, this is a solution I wasn't very happy about, but at the moment it seems as the only one.
The point is to ignore the built in toolbar property of UINavigationController, create separate UIToolbar and place it inside your view controller.
This way the toolbar will slide away with it's view, causing no animation issue such as "white rectangles" or late appearing toolbar when placed in viewDidAppear...
听起来你想要:
It sounds like you want: