ios - 是否可以为用户输入禁用 UISearchController?

标签 ios swift modal-dialog uisearchcontroller

我有这个项目,其中弹出一个模态,用于过滤搜索结果 - 当模态弹出时,UISearchController 在我的导航栏中可见。我无法删除它,因为它看起来很奇怪,因为模态不会填满整个屏幕。问题是,当模式弹出时 UISearchController 仍然处于事件状态,如果我点击它,一切都会变得疯狂 - 所以我想禁用输入字段,但我真的找不到如何:/

那么有人知道如何禁用 UISearchController 中的输入字段吗?

最好的问候:-)

最佳答案

self.searchDisplayController.searchBar.userInteractionEnabled = false

关于ios - 是否可以为用户输入禁用 UISearchController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42830763/

相关文章:

html - Bootstrap Modal Dropdown 隐藏在 Modal 后面

ios - 单个 View 中的两个 UITableView

ios - 根据通知数量增加角标(Badge)值

python - 如何使用 Webdriver 和 Python 与此模式对话框进行交互?

jquery - TinyMCE 和 JQuery 对话框 : TinyMCE read only when modal:true in the Dialog

ios - adddependency 方法在 NSOperationQueue 中的工作原理

ios - 在 swift 3 中下载文件最多只能完成 24 kb?使用 URLSession

objective-c - 在 iOS 应用程序中嵌入 SoundCloud 播放器

ios - 创建列表对象 Swift

ios - 在特定 View 上退出应用程序