有没有办法让我的图片呈现出这样的效果(圆角和浅色边框)?
我想创建一个白色遮罩,中间透明,放在图片上面,这样行吗?
![enter image description here](https://istack.dev59.com/0Aguv.webp)
您可以实现这一点,但不要编辑UIImage,只需在UIImageView中进行操作。
首先,添加QuartzCore头文件。
#import <QuartzCore/QuartzCore.h>
然后,根据您的意愿编辑下面的属性。
imageView.layer.cornerRadius = 5.0;
imageView.layer.borderColor = [[UIColor grayColor] CGColor];
imageView.layer.borderWidth = 2.0;
imageView.layer.masksToBounds = YES;