是否可以像编辑 "Share" 按钮一样自定义 SFSafariViewController?
Is it possible customize SFSafariViewController like edit "Share" button?
是否可以像这样自定义 SFSafariViewController:
- 更改 "Share" 按钮
- 或者在 "Share" 和 "Compass" 按钮所在的同一工具栏上添加新按钮
如有任何帮助,我们将不胜感激。
没有。但是,您可以更改该控制器的某些特定配置。即:
- 到
SFSafariViewControllerConfiguration
,你有 barCollapsingEnabled
和 entersReaderIfAvailable
。
activityItemsForURL
和 excludedActivityTypesForURL
的数据。
preferredBarTintColor
和 dismissButtonStyle
,等等...
Apple 说:
Important
In accordance with App Store Review Guidelines, this view controller
must be used to visibly present information to users; the controller
may not be hidden or obscured by other views or layers. Additionally,
an app may not use SFSafariViewController to track users without their
knowledge and consent.
最后,事实上,您可以使用 WKWebView
来进一步自定义您的屏幕。
If your app lets users view websites from anywhere on the Internet,
use the SFSafariViewController class. If your app customizes,
interacts with, or controls the display of web content, use the
WKWebView class.
阅读文档:https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller
是否可以像这样自定义 SFSafariViewController:
- 更改 "Share" 按钮
- 或者在 "Share" 和 "Compass" 按钮所在的同一工具栏上添加新按钮
如有任何帮助,我们将不胜感激。
没有。但是,您可以更改该控制器的某些特定配置。即:
- 到
SFSafariViewControllerConfiguration
,你有barCollapsingEnabled
和entersReaderIfAvailable
。 activityItemsForURL
和excludedActivityTypesForURL
的数据。preferredBarTintColor
和dismissButtonStyle
,等等...
Apple 说:
Important
In accordance with App Store Review Guidelines, this view controller must be used to visibly present information to users; the controller may not be hidden or obscured by other views or layers. Additionally, an app may not use SFSafariViewController to track users without their knowledge and consent.
最后,事实上,您可以使用 WKWebView
来进一步自定义您的屏幕。
If your app lets users view websites from anywhere on the Internet, use the SFSafariViewController class. If your app customizes, interacts with, or controls the display of web content, use the WKWebView class.
阅读文档:https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller