Swift - 从UISearchController 中删除默认的"Go-to-top-on-active"函数



默认情况下,当您单击文本字段时,UISearchController会移动到屏幕顶部。有没有办法阻止这种行为的发生?

您应该能够通过在UISearchController:上设置某个属性来防止这种行为

self.searchController.hidesNavigationBarDuringPresentation = false

有关此属性的更多详细信息,请参阅苹果的文档

最新更新