searchController.isActive为FUISearchController返回false

2020-08-16 01:00发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨,我已经用范围按钮实现了FUI...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,
我已经用范围按钮实现了FUISearchController,但是第一次出现searchController时searchController.isActive返回false,这使得我的isFiltering也为false。 奇怪的是,仅将searchController类型更改为UISearchController即可进行更改,所有操作均应按应有的方式进行。 开始键入时,该属性会设置为true。

难道该属性在FUISearchController的实现中会被覆盖吗?

某些代码:

 private var searchController = FUISearchController(searchResultsController:nil 

private var isSearching:Bool { 让searchBarScopeIsFiltering = searchController.searchBar.selectedScopeButtonIndex!= 0 返回searchController.isActive &&(!isSearchBarEmpty || searchBarScopeIsFiltering)
}

ViewDidLoad

 searchController.searchBar.delegate =自己
searchController.searchResultsUpdater =自己 searchController.hidesNavigationBarDuringPresentation = true searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.placeholder ="搜索客户"
> searchController.searchBar.scopeButtonTitles = customerSearchTypes.allCases.map {$ 0.rawValue}
navigationItem.searchController = searchController
6条回答
CJones
2020-08-16 01:44

朱建华

我发现的另一个错误(在将searchController更改为UISearchController时也已修复),如果取消按模态显示,则点击cancel会关闭整个viewController!

"我的客户" VC既从TabBarController呈现,也从模式呈现的CartVC呈现。 尝试从模态显示的购物车中将客户添加到购物车时,在searchBar中点击"取消"可取消搜索,然后自动关闭整个ViewController。

如果可以同时解决该问题,那就太好了:)

一周热门 更多>