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.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...