如何在没有 UISearchDisplayController 的情况下为 UISearchBar 滑入和滑出视图设置动画?
我有一个视图,它有一个按钮,可以使用
searchBar.hidden = !searchBar.hidden;
搜索栏切换 UISearchBar
,并查询 Web 服务以获取结果,然后将它们显示给用户,而无需使用 UITableView
> 或本地数据源或任何东西。因此,我真的不想使用 UISearchDisplayController 来制作动画。
有没有办法在不手动编码动画的情况下为这种滑动设置动画?
谢谢!
I have a view that has a button which toggles a UISearchBar
using
searchBar.hidden = !searchBar.hidden;
The searchbar goes out and queries a web service to get results and then displays them to the user without ever using a UITableView
or a local datasource or anything. As such I don't really want to use a UISearchDisplayController to do the animation.
Is there anyway to animate this sliding without manually coding up the animation?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
继续使用 UISearchDisplayController。它不是一个非常重的物体。您编写的用于替换其功能的任何代码肯定会比 UIKit 中已有的类实例占用更大的空间。
Go ahead and use the UISearchDisplayController. It's not a terribly heavyweight object. Any code you write to replace its functionality is certainly going to have a bigger footprint than an instance of a class you've already got in the UIKit.