【问题标题】:How do I move the position of the .searchable() Swift search bar from default?如何从默认位置移动 .searchable() Swift 搜索栏的位置?
【发布时间】:2022-11-17 12:47:40
【问题描述】:

这个问题 (https://developer.apple.com/forums/thread/682602) 解释得比我好得多。我想要一种将 NavigationViews 中屏幕顶部附带的搜索栏移动到自定义位置的方法。这在 iOS 15 及之前的版本上可行吗?或者,甚至在 iOS 16 上?

【问题讨论】:

    标签: swift swiftui


    【解决方案1】:

    https://developer.apple.com/documentation/swiftui/presentedwindowcontent/searchable(text:tokens:suggestedtokens:placement:prompt:token:)-60iob

    没有位置参数。它有placement参数但是它控制总是显示,自动显示。

    您可能会为搜索栏创建自己的组件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多