简体   繁体   English

使用 SVG 时 SF 符号不可用警告

[英]SF Symbol unavailable warning when using an SVG

My app supports iOS 13.0 and uses SF Symbols in a storyboard.我的应用程序支持 iOS 13.0 并在 storyboard 中使用 SF 符号。 I have added the SF Symbol .svg file to my asset catalog to add support for those that are only available in iOS 14+ but I am still getting the compiler warnings saying我已将 SF Symbol .svg文件添加到我的资产目录中,以添加对仅在 iOS 14+ 中可用的文件的支持,但我仍然收到编译器警告说

SF Symbol 'square.and.arrow.up' is unavailable prior to iOS 14.0. SF 符号“square.and.arrow.up”在 iOS 14.0 之前不可用。 Add a fallback image of the same name to the asses catalog for backward deployment将同名的后备图像添加到 asses 目录以进行向后部署

I have confirmed the symbols work on iOS 13.我已经确认符号在 iOS 13 上有效。

If I click on one of the warnings, it takes me to the storyboard and the warning goes away.如果我单击其中一个警告,它会将我带到 storyboard 并且警告消失。 As soon as I navigate to another file, the warnings reappear.一旦我导航到另一个文件,警告就会再次出现。

Is there a way to get rid of these or could this be an Xcode bug?有没有办法摆脱这些或者这可能是一个 Xcode 错误?

I managed to find a solution to this.我设法找到了解决方案。 Rename the .svg in the asset catalog to something different (I just added X- to the beginning), then change the image used in the storyboard to the new X- one.将资产目录中的.svg重命名为不同的名称(我只是在开头添加了X- ),然后将 storyboard 中使用的图像更改为新的X- It's the same SF Symbol and works exactly the same for iOS 13+ but because it's not the system build in one, the warnings go away:)它是相同的SF Symbol ,对于 iOS 13+ 的工作方式完全相同,但因为它不是系统内置的,所以警告 go 消失了:)

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

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