Reputation: 3130
This seems like a silly question, but I have a UITableView
and each row has a UIImageView
with a dimension of 80x80
. The actual content of the image is either 80x80
or 80x64
. I recently added some new 80x64
images and the heights of those are being stretched whereas the old 80x64
images are not (they are simply centered within the 80x80
frame).
I vaguely remember setting some kine of xattr on my images a while back, but I can't seem to find what it was. Would this have something to do with my new images being stretched vertically?
Upvotes: 2
Views: 1384
Reputation: 437422
You might want to look at the contentMode
for your image view, specifically try UIViewContentModeScaleAspectFit
. I notice this, especially, when I set image
properties for UITableViewCell
cells asynchronously. But if I have the routine that is setting the image
to also set the contentMode
, and all is well.
Upvotes: 4