无法与iOS 11 SearchController中的视图进行交互?

时间:2018-05-16 05:39:10

标签: ios swift navigation ios11 uisearchcontroller

我无法触摸视图或滚动查看iOS 11 didpresentSearchcontroller的{​​{1}}或willpresentSearchcontroller方法的桌面视图,如屏幕截图所示。有某种调光或SearchController不允许我触摸视图控制器或滚动桌面视图。我认为它禁用了视图。 enter image description here

greycolor视图不允许我触摸viewcontroller或tableview。

enter image description here

我如何与viewcontroller交互或滚动tableview。

我想仅在此视图控制器上显示结果。

UISearchView

2 个答案:

答案 0 :(得分:0)

我明白了。 使用

let searchController = UISearchcontroller()
func willPresentSearchController(_ searchController: UISearchController) {
    searchController.dimsBackgroundDuringPresentation = false


}

答案 1 :(得分:0)

从iOS 12开始,它是:

searchController.obscuresBackgroundDuringPresentation = false

您应该在刷新搜索之前添加它。