![](/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.