我正在拍摄一张个人资料照片。
我在故事板上添加了一个uiImageView(比如userImageView),它具有纵横比模式,可以填充和添加到我的swift文件中的代码下面
self.userImageView.layer.borderWidth = 10 self.userImageView.layer.borderColor = UIColor.white.cgColor self.userImageView.layer.cornerRadius = self.userImageView.frame.height/2 self.userImageView.clipsToBounds = true
但当试图从相机或相册中添加图像时,图像会被压缩。
我还尝试调整图像的大小,但图像仍在被压缩。
我做错什么了?
在故事板内容模式中,是Aspect Fill或Fit,然后单击剪辑以限制其帮助以使图像适合图像视图边界。