If you want to have the UIImageView
to always be a square and set the an aspect ratio on the width and height.
However if you want to resize the UIImage
depending on the size of the imageView then in your custom UICollectionViewCell
make the necessary adjustments in the layoutSubviews()
. Here you can inspect the size of the UIImageView
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.