The GIS Guy
  • Home
  • iOS
  • Web
  • GIS

UIImage

A collection of 1 post

iOS

UIImage Rendering Mode

最近调第三方代码的过程中发现,有一个 UIImage,无论将图片替换成什么,在页面上始终显示成蓝色。经过代码阅读,终于发现了猫腻: [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 简化版代码: theImageView.image = [theImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; [theImageView setTintColor:[UIColor redColor]]; theImageView.image = [theImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; [theImageView setTintColor:[UIColor redColor]]; WatchKit 中的使用

Jon Jon
The GIS Guy © 2025
Latest Posts Ghost