UISearchDisplayController - 单击覆盖,调用方法?
当用户单击深色覆盖层时,是否有一个委托方法被调用,这基本上从 UISearchDisplayController 中删除了第一响应者状态? (我在文档中找不到。)
我想知道用户何时单击黑色覆盖层,并且键盘被隐藏。
Is there a delegate method that gets called when a user clicks on the dark overlay, which basically removes first responder status from the UISearchDisplayController? (I cannot find one in the docs.)
I would like to know when users click the black overlay, and the keyboard is hidden.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您实现 UISearchDisplayDelegate 那么:
应该在点击覆盖层时调用。
几个月前我对这个组件进行了一些修改,但最终没有使用它,因为你无法改变它的标准行为太多。
我发现它只是
UISearchBar
的包装器,因此您可以像这样访问SearchDisplayController
上的 searchBar:这种方式给您更多的自由访问 searchBar 组件本身的委托方法。如
textDidChange
、cancelButtonClicked
等。If you implement the UISearchDisplayDelegate then:
should be called upon tapping the overlay.
I messed around with this components a few months back but ended up not using it because you can not change its standard behavior much.
What I did found out is that it is just a wrapper for the
UISearchBar
, so you can access the searchBar on yourSearchDisplayController
like this:This way gives you a bit more freedom to access the delegate methods of the searchBar component itself. Like
textDidChange
,cancelButtonClicked
etc.