【发布时间】:2014-02-20 12:03:45
【问题描述】:
Safari 浏览器上的后退和前进按钮是否可以在 iOS 上使用?我一直在查看 UIButton 和 UIBarbuttonItem 类,但在这些类下看不到这些图标。谁能告诉我它们是否可用或者浏览器是否使用自定义图标?
这是浏览器上后退和前进按钮的外观
【问题讨论】:
标签: ios iphone ios7 uibutton uibarbuttonitem
Safari 浏览器上的后退和前进按钮是否可以在 iOS 上使用?我一直在查看 UIButton 和 UIBarbuttonItem 类,但在这些类下看不到这些图标。谁能告诉我它们是否可用或者浏览器是否使用自定义图标?
这是浏览器上后退和前进按钮的外观
【问题讨论】:
标签: ios iphone ios7 uibutton uibarbuttonitem
在How to make iOS UIToolbar with back/forward arrows on the left 上查看我对此的回答。我自己做的,因为你发现它们不包括在内。我在Paint Code 中制作了它们。
【讨论】:
如果你的目标是iOS13及以上,可以使用苹果提供的内置SF Symbols库。
chevron.left 图像用于 Safari 后退按钮。
let chevronLeft = UIImage(systemName: "chevron.left")
let backButton = UIBarButtonItem(image: chevronLeft, style: .plain, target: webView, action: #selector(webView!.goBack))
这些图标还有从超轻到黑色的九种粗细,可以这样应用。
let chevronLeft = UIImage(systemName: "chevron.left", withConfiguration: UIImage.SymbolConfiguration(weight: .thin))
更多信息可从 Apple 获得:SF Symbols
【讨论】: