ios – UIImage RenderingMode:UIImageRenderingModeAutomatic vs UIImageRenderingModeAlwaysOriginal vs UIImageRenderingModeAlwaysTemplate [closed]

前端之家收集整理的这篇文章主要介绍了ios – UIImage RenderingMode:UIImageRenderingModeAutomatic vs UIImageRenderingModeAlwaysOriginal vs UIImageRenderingModeAlwaysTemplate [closed]前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经遇到了在iOS 7中引入的UI Image属性UI ImageRenderingMode.但是我没有得到UIImageRenderingModeAutomatic,UIImageRenderingModeAlwaysOriginal和UIImageRenderingModeAlwaysTemplate的不同UIImageRenderingMode之间的差异.

我想知道他们的基本含义,何时/如何使用它们.

解决方法

我发现一个 tutorial说明了UIImageRenderingMode的例子.

从教程:

UIImageRenderingModeAlwaysTemplate mode will replace all non-transparent colors on
a UIImage with the tint color. The entire background and any portion of the image
that you do not wish to render using the tint color must be completely transparent.

UIImageRenderingModeAlwaysOriginal. When this is applied the tint color is never
applied to the image so the original color is always used when rendering the
image.

UIImageRenderingModeAutomatic automatically decides which rendering mode to use based on where the image is being displayed. This is the default value for images.

原文链接:https://www.f2er.com/iOS/330111.html

猜你在找的iOS相关文章