我有 4 个 UIImageViews 的自定义 UITableViewCell。我在 UIImageView.image 中设置了不同大小的图像,但我想缩放它的比例(顶部/底部和左侧/右侧没有黑线。我该怎么做?
您可以使用 contentMode 属性来缩放图像。
如果要将图像在图像视图框架中的图像调整为其纵横比,请设置
imageView.contentMode = UIViewContentModeScaleAspectFit。也可以尝试使用 AspectFill。
设置imageView的backgroundColor为clearColor;
| 归档时间: |
|
| 查看次数: |
3710 次 |
| 最近记录: |