ios - 尝试使 UISearchController 功能像 iPhone 中的语言设置一样 Swift

标签 ios swift uisearchcontroller

我目前已经实现了一个 UISearchController,目前工作正常。以下是显示操作方法的附加屏幕:

enter image description here

enter image description here

enter image description here

enter image description here

但是,我想做的是以类似于 Apple 在 iPhone 设置中实现语言选择选项的方式来实现它:

enter image description here

enter image description here

enter image description here

在Apple的实现中,搜索栏在事件时不会隐藏导航栏。有谁知道如何在 Swift 中实现此功能,而不是我目前实现的传统方式?只是想知道。

最佳答案

有一个名为 hidesNavigationBarDuringPresentation 的属性在 UISearchController 类中,默认为 true 处理您想要的内容,因此将其放入 false 中,您可以实现保留导航栏在演示过程中,就像 Apple 在语言选项中所做的那样:

searchbBarController.hidesNavigationBarDuringPresentation = false

希望对你有帮助

关于ios - 尝试使 UISearchController 功能像 iPhone 中的语言设置一样 Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37932085/

相关文章:

swift - 在 swift 中将带有参数的函数分配给变量

ios - 每次点击取消按钮时,搜索栏都会向下跳一行

ios - SDwebimage EXC_BAD_ACCESS

javascript - 列表项背景颜色在 Ipad 上不会改变

ios - UIStoryboardSegue sourceViewController 在 destinationViewController 之上

ios - 如何为完整的应用程序实现 uisearchcontroller

ios - 如何在数组类型为 JSON 时实现自定义搜索栏

ios - 类似键盘的弹出按钮,iOS

swift - 创建 FireStore 数据结构

ios - 将 MapperObject 映射到 Model-swift