在 iPhone 中结束搜索时禁用动画
快速:有没有办法在没有动画的情况下关闭键盘和 searchDisplayController ?
当用户按“取消”时,我能够做到这一点,但是当用户按搜索字段上方的黑色“窗口”(仅在用户未插入任何文本时可见)时,动画总是会发生,即使我更改委托功能。
有没有办法控制这个,或者作为替代方案,禁止用户通过按黑色窗口来结束搜索?
提前致谢。
A quicky: is there a way to dismiss the keyboard and the searchDisplayController without animation?
I was able to do it when the user presses "Cancel", but when the user presses the black "window thingy" above search field (only visible while the user hasn't inserted any text), the animation always occurs, even when I change the delegate functions.
Is there a way to control this, or as an alternative, to disable the user to end searching by pressing the black window?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以手动停用搜索显示控制器以避免动画:
尝试将其放入
- (void)viewWillDisappear
中,看看在离开表格视图时是否会阻止动画。You can manually de-activate the search display controller to avoid the animation:
Try putting it in
- (void)viewWillDisappear
to see if that prevents the animation when navigating away from your table view.