简体   繁体   English

Safari 浏览器工具栏上的按钮

[英]Buttons on the Safari browser toolbar

Are the back and forward buttons on the Safari browser available to use on iOS? Safari 浏览器上的后退和前进按钮是否可以在 iOS 上使用? I have been looking in the UIButton and UIBarbuttonItem class and I don't see those icons under these classes.我一直在查看UIButtonUIBarbuttonItem类,但在这些类下没有看到这些图标。 Can someone tell me if they are available or is the browser using custom icons?有人可以告诉我它们是否可用或者浏览器是否使用自定义图标?

Here is how the back and forward button look on the browser这是浏览器上的后退和前进按钮的外观浏览器

Check out my answer to this at How to make iOS UIToolbar with back/forward arrows on the left . 在左侧如何制作带有后退/前进箭头的 iOS UIToolbar 中查看我对此的回答。 I made them myself because they are not included as you have found out.我自己做的,因为你发现它们不包括在内。 I made them in Paint Code .我在Paint Code 中制作了它们。

If you are targeting iOS13 and above, you can use the built-in SF Symbols library provided by Apple.如果您的目标是 iOS13 及以上,则可以使用 Apple 提供的内置SF Symbols库。

The chevron.left image is used for the Safari back button. chevron.left图像用于 Safari 后退按钮。

let chevronLeft = UIImage(systemName: "chevron.left")
let backButton = UIBarButtonItem(image: chevronLeft, style: .plain, target: webView, action: #selector(webView!.goBack))

These icons also come in nine weights from ultralight to black, which can be applied like this.这些图标也有从超轻到黑色的九种权重,可以这样应用。

let chevronLeft = UIImage(systemName: "chevron.left", withConfiguration: UIImage.SymbolConfiguration(weight: .thin))

More information is available from Apple here: SF Symbols更多信息可从 Apple 获得: SF Symbols

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM