如何从图像中分离出边框?

问题描述 投票:0回答:3

如何使边框远离图像而不是直接附加到它上面就像你在屏幕截图中看到的那样enter image description here

ios swift uiimageview constraints
3个回答
1
投票

要设置圆角,必须设置

imageView.layer.cornerRadius = 9 //Or any other number

为了使边界更远离边界,只需更改约束的值。


0
投票

试试这个

imageView.layer.cornerRadius = 10
imageView.layer.masksToBounds = true

0
投票

我不知道我是否正确理解了这个问题,但你可能正在寻找类似的东西:

imageView.contentMode = .scaleAspectFit
© www.soinside.com 2019 - 2024. All rights reserved.