【问题标题】:Buttons on the Safari browser toolbarSafari 浏览器工具栏上的按钮
【发布时间】:2014-02-20 12:03:45
【问题描述】:

Safari 浏览器上的后退和前进按钮是否可以在 iOS 上使用?我一直在查看 UIButtonUIBarbuttonItem 类,但在这些类下看不到这些图标。谁能告诉我它们是否可用或者浏览器是否使用自定义图标?

这是浏览器上后退和前进按钮的外观

【问题讨论】:

    标签: ios iphone ios7 uibutton uibarbuttonitem


    【解决方案1】:

    How to make iOS UIToolbar with back/forward arrows on the left 上查看我对此的回答。我自己做的,因为你发现它们不包括在内。我在Paint Code 中制作了它们。

    【讨论】:

      【解决方案2】:

      如果你的目标是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

      【讨论】:

        猜你喜欢
        • 2019-07-25
        • 1970-01-01
        • 2012-01-01
        • 2013-12-26
        • 1970-01-01
        • 2012-02-29
        • 2018-03-07
        • 1970-01-01
        • 2021-11-06
        相关资源
        最近更新 更多