作者:lumanman158 | 来源:互联网 | 2023-01-03 16:27
我正在添加这样的搜索控制器:
viewController.navigationItem.searchCOntroller= searchController
viewController.navigationItem.hidesSearchBarWhenScrolling = false
viewController.definesPresentatiOnContext= true
searchController.dimsBackgroundDuringPresentation = false
searchBarContainer.translatesAutoresizingMaskIntoCOnstraints= false
searchBarContainer.heightAnchor.constraint(equalToConstant: 0).isActive = true
当尝试向右滑动以弹出当前viewController(此处激活交互式pop手势)但停留在同一个控制器上时,搜索栏就会消失.
viewController.navigationItem.searchController
保持添加搜索控制器,但它不可见.