显示搜索结果
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
SFSafariViewController
默认情况下,点击搜索组件后,相应的 Google 搜索结果将显示在 SFSafariViewController 中。您可以使用视图选项来自定义其高度。
视图选项
每个 SearchSuggestionsViewController
、SearchSuggestionsView
、SearchContentViewController
、SearchContentView
都可以使用 SearchSuggestionsViewOptions/SearchContentViewOptions 进行自定义。
可用选项包括布局、主题、detentOption
和 customizedSheetHeightFraction
。
布局决定了搜索建议的显示方式。可用的选项包括 carousel
、compact carousel
和 tiling
。
借助该主题,您的应用可以指定浅色模式、深色模式或与系统外观保持一致。
detentOption
(预定义高度模式)和 customizedSheetHeightFraction
(仅适用于 iOS 16.0 及更高版本,完全自定义高度)可用于调整显示 Google 搜索页的底部工作表 (SFSafariViewController) 的高度。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],["Clicking a search component displays Google Search results in an SFSafariViewController. This view's height is customizable via View Options, including layout, theme, `detentOption`, and `customizedSheetHeightFraction`. Layout options include carousel, compact carousel, and tiling. Themes allow for light, dark, or system-matched appearances. `detentOption` offers predefined height modes, while `customizedSheetHeightFraction` (iOS 16.0+) allows for full height customization. These options apply to `SearchSuggestionsViewController` and `SearchContentViewController`.\n"]]