【问题标题】:Detect when SearchController is appeared in UINavigationItem检测 SearchController 何时出现在 UINavigationItem
【发布时间】:2019-09-09 18:44:17
【问题描述】:

我在出现 NavigationControllerSearchController 时遇到问题。如何检测 searchController 何时出现?我刚试过navigationItem.searchController?.isBeingPresented,但它没有用,它显示我总是错误的。我试过isActive,但它也显示我是假的。

我必须这样做,因为当我将 ViewControllers 推入 NavigationControllers 时,它会制作丑陋的隐藏动画...我在其中有一个 ViewController,当我单击一个项目时有一个 SearchController 它会显示新的 ViewController 在哪里也是 SearchController。

感谢您的帮助

【问题讨论】:

    标签: ios swift animation uinavigationcontroller


    【解决方案1】:

    好的,我解决了。您可以使用navigationItem.searchController?.searchBar.frame.height,它会在 searchController 出现与否时显示。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-24
      • 1970-01-01
      • 2020-05-08
      • 1970-01-01
      相关资源
      最近更新 更多