0

我正在使用 SwiftUI SF Symbols,在 iOS 14 上运行良好,但在 iOS 13 上运行良好,错误如下:

[SwiftUI] No system image named 'doc.badge.gearshape' was found
[SwiftUI] No system image named 'airport.express' was found
[SwiftUI] No system image named 'rectangle.badge.plus' was found

用法很简单:

Image(systemName: "doc.badge.gearshape")

如果这是因为图标仅在 iOS 14 上退出,那么解决此问题的正确方法是什么?我必须使用:

if #available(iOS 14.0, *) {
        Image(systemName: "doc.badge.gearshape")
} else {
    Image("xxx")
}
4

1 回答 1

1

你说的对。这些是从 iOS 14.0 添加的符号。iOS 14.0 中的新符号

正如您在上面的代码片段中已经提到的,您将不得不为 iOS 13.0 使用替代图像。

于 2021-01-30T14:54:33.787 回答