![](/img/trans.png)
[英]How to resize an image view to fit the image and scale appropriately for an iPhone swift
[英]How to scale the image to fit the image view in ios?
我将图像放在xcode的图像视图中并设置“缩放到适合”模式,但我发现图像不符合图像视图的大小。 那么如何使图像适合ios中图像视图的大小?
以下是故事板的截图。
要在故事板中执行此操作,请选择UIImageView
,打开“属性”检查器,然后从“模式”下拉菜单中选择“Aspect Fill”或“Aspect Fit”。
有几种方法可以玩:
imageView.contentMode = UIViewContentMode.ScaleAspectFill
imageView.contentMode = UIViewContentMode.ScaleAspectFit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.