Using different modes such as "Scale To Fill", "Aspect Fit", "Aspect Fill" to control UIImageView inside UITableViewCell
I used UIImageView
internally UITableViewCell
and it will fill contentView. I tried another mode like "Scale To Fill", "Aspect Fit", "Aspect Fill" to pass the UIImageView inside the UITableViewCell. UIImageView inside UITableViewCell ends screen in Aspect Fill. I have set image limits as shown below
It works great as below
But when the image size is too large, it shows the problem as below. goes outside the cell
I have
Aspect Fill
like below.
when i use
Aspect Fit
i got this problem
When i use
Scale To Fill
i got this problem
In
Aspect Fit
andScale To Fill
I got left and right box like abovebelow link doesn't address my problem so it doesn't duplicate
UIImageView inside UITableViewCell not updating
Resizing UIImageView inside UITableViewCell
iOS 8 - AutoLayout issue - UIImageView inside UITableViewCell ignores width constraints
source to share
As you describe All restrictions are set correctly.
Aspect Fill will draw everything inside the imageView while maintaining the aspect ratio of the image. If the image is larger than the image size, the image overflows. In such cases, you need to activate the "Clips subview" option in your ImageView's attribute inspector.
Go to your cellViewView attribute id in storyboard / xib. In the Draw section, select Clip Movements as True.
This will make the supervisor encrypted. In your case cellViewView is superview and imageView is subview.
source to share