[英]How to make Flexslider display different aspect ratio images on iOS?
[英]How to give the aspect ratio to images in iOS
我已經創建了圖像視圖,並根據API響應動態設置圖像。 我以編程方式設置了圖像和約束,並沒有使用任何故事板文件。 目前我正在設置圖像視圖的內容模式。 現在我想以編程方式將比率值設置為21:9。 是否可以給圖像賦予比率值?
提前致謝!
你可以使用:
imageView.heightAnchor.constraint(equalTo: imageView.widthAnchor, multiplier: 21/9).isActive = true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.