ios - UIImage 渲染模式 : UIImageRenderingModeAutomatic vs UIImageRenderingModeAlwaysOriginal vs UIImageRenderingModeAlwaysTemplate

标签 ios objective-c ios7 uiimage

<分区>

我遇到了 iOS 7 中引入的 UIImage 属性 UIImageRenderingMode。但是我不明白不同 UIImageRenderingMode 之间的区别是 UIImageRenderingModeAutomaticUIImageRenderingModeAlwaysOriginalUIImageRenderingModeAlwaysTemplate

我想知道它们的基本含义以及何时/如何使用它们。

最佳答案

我找到了一个 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.

关于ios - UIImage 渲染模式 : UIImageRenderingModeAutomatic vs UIImageRenderingModeAlwaysOriginal vs UIImageRenderingModeAlwaysTemplate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21200582/

相关文章:

sqlite - 使用 NSReadOnlyPersistentStoreOption 时崩溃

ios7 - 访问资源目录路径

ios - 如何将 UIImage 旋转 90 度?

ios - SpriteKit 物理每次都会给出不同的结果

ios - valueForUndefinedKey :]: this class is not key value coding-compliant for the key imgSelect Swift

iOS 7/8 : How do I set the Navigation Bar to be pure white (#FFFFFF) and still maintain translucency?

ios - 将自定义 UITableViewCell 滚动到键盘上方?

ios - 从 Jenkins 引用 Xcode 版本号

objective-c - 在 UITextField 中输入数字后,如何使小键盘消失?

ios - objective-c 中具有三个按钮(带图标)的自定义单元格