这可能是你一整天都看到的最愚蠢的问题,但我找不到解决办法。我有一个带有边框的圆形图像视图,我希望边框与Xcode中的默认色调颜色相同,所以如果您能提供帮助的话,那就太好了。对这个粗野的问题感到抱歉;)
,现在我有了这个:
self.imageView.layer.borderColor = UIColor.gray.cgColor我需要改变
UIColor.gray.cgColor要使与默认的色调颜色相同的蓝色而不引起崩溃或错误.怎么做呢?
谢谢你的帮助。
发布于 2017-07-02 13:43:51
只需创建具有蓝色属性的新颜色并应用于imageView
let color = UIColor(colorLiteralRed: 0, green: 122/255, blue: 1, alpha: 1.0)
self.imageView.layer.borderColor = color.cgColor警觉地,您可以使用tintColor属性imageView
imageView.layer.borderColor = imageView.tintColor.cgColor发布于 2017-07-02 13:50:14
只需拖放任何您想要的颜色,如:

https://stackoverflow.com/questions/44871341
复制相似问题