我想使用简单的图标,例如 iOS 设置左侧使用的图标.使用 svg 与 png 有什么优势吗? [英] I would like to use simple icons such as those used on the left hand side of Settings in iOS. Any advantage to using svg vs png?

查看:40
本文介绍了我想使用简单的图标,例如 iOS 设置左侧使用的图标.使用 svg 与 png 有什么优势吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将图标构建为 svg 或 png 一样容易.

I have icons built as svg or png just as easily.

对于那些使用 svg 的人,你用什么方法来显示这些?

Also for those people that are using svg, what's the method you are using to display these?

推荐答案

官方 iOS 开发文档说PNG 格式是最推荐在您的应用程序中使用的格式".您可以在这里阅读更多信息.

Official iOS Dev documentation says "the PNG format is the one most recommended for use in your apps". You can read it for a lot more information here.

虽然支持的文件类型表没有列出 .SVG.Apple 重视用户体验.SVG 缩放会消耗更多他们不喜欢的 CPU 周期.PNG 渲染比 SVG 更高效,但在放大/缩小场景等情况下,SVG 会更好.

although the supported file types table doesn't list .SVG. Apple values user experience. SVG scaling consumes a few more CPU cycles which they don't like. PNG rendering is more efficient than SVG,and there are cases like zoom-in / out scenarios where SVGs would be better though.

如果您想在 Xamarin Forms 中跨平台使用 SVG 图标,您可以使用 Xamarin.FFImageLoading.Svg.Forms 库,它使我们能够轻松实现这一目标.

if you want to use SVG icons across platforms in Xamarin Forms,you could use the Xamarin.FFImageLoading.Svg.Forms library which allow us to achieve this easily.

你可以参考的越多 带有 FFImageLoading 的 SVG 图标

这篇关于我想使用简单的图标,例如 iOS 设置左侧使用的图标.使用 svg 与 png 有什么优势吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆