Raf*_*nço 5 ios catransaction uisearchcontroller swift4
我实现了一个searchController并添加到navigationItem中.
这是代码:
var searchController = UISearchController(searchResultsController: nil)
searchController.obscuresBackgroundDuringPresentation = false
definesPresentationContext = true
searchController.searchResultsUpdater = self
searchController.searchBar.placeholder = NSLocalizedString("Search", comment: "")
searchController.hidesNavigationBarDuringPresentation = true
// Layout
searchController.searchBar.barTintColor = UIColor.groupTableViewBackground
navigationItem.searchController = searchController
Run Code Online (Sandbox Code Playgroud)
当我在searchBar中单击以写入内容时,此警告将显示在控制台中:
NameOfProject [9238:211033] + [CATransaction synchronize]在事务中调用NameOfProject [9238:211033] + [CATransaction synchronize]在事务中调用NameOfProject [9238:211033] + [CATransaction synchronize]在事务中调用NameOfProject [9238:211033] + [在事务中调用的CATransaction synchronize]
拜托,有人知道如何解决这个问题?
提前致谢!!
有一个相关的帖子。
这篇文章指出,这种行为可能是 iOS 端的一个错误,因为它也发生在一个仅包含一个 UIViewController 的最小示例中,该 UIViewController 包含一个 UISearchController 并嵌入到 UINavigationController 中(请参阅Upholder Of Truth的评论)。
归档时间: |
|
查看次数: |
880 次 |
最近记录: |