【问题标题】:How can I create a macOS SwiftUI button with the NSRefreshTemplate image?如何使用 NSRefreshTemplate 图像创建 macOS SwiftUI 按钮?
【发布时间】:2020-04-04 07:19:13
【问题描述】:

我不知道如何访问 SwiftUI 按钮的 NSRefreshTemplate 图像。有什么方法可以访问系统映像吗?

Button(action: {
  print("Do something...")
}) {
    Image("NSRefreshTemplate")
}.buttonStyle(BorderlessButtonStyle())

SF 符号在哪里适合这些系统映像以及如何访问这些 SF 符号?

【问题讨论】:

    标签: swiftui sf-symbols


    【解决方案1】:

    答案如下图

    Button(action: {
      print("Do something...")
    }) {
       Image(nsImage: NSImage(named: NSImage.refreshTemplateName)!)
    }.buttonStyle(BorderlessButtonStyle())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-11-11
      • 1970-01-01
      • 2020-12-30
      • 1970-01-01
      • 2011-10-28
      • 2010-11-18
      • 1970-01-01
      相关资源
      最近更新 更多