那将是正确的语法:
(对于 Swift 3.x 或 Swift 4 )
var image: UIImage? = UIImage(named:"myImage")?.withRenderingMode(.alwaysOriginal)
(对于 Swift 2.x )
var image: UIImage? = UIImage(named:"myImage.png").imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
但您也可以使用此“快捷方式”:
var image: UIImage? = UIImage(named:"myImage.png").imageWithRenderingMode(.AlwaysOriginal)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)