开发者

UIImageView is clipping a pixel of the bottom of my UIImage...?

开发者 https://www.devze.com 2022-12-23 17:16 出处:网络
I\'m not sure what might be causing this, but UIImageView occasionally clips off about a pixel or 2 from the bottom of some square/rectangular UIImages I\'m using as subviews for UITableViewCells. The

I'm not sure what might be causing this, but UIImageView occasionally clips off about a pixel or 2 from the bottom of some square/rectangular UIImages I'm using as subviews for UITableViewCells. These UIImageViews are well within the borders of the cell, so it shouldn't be due to cliptobounds. There seems to be no consistency or pattern to which images are being clipped, nor when they're clipped, other than that it only happens to (or is only noticable in) square/rectangular icons, and only ones that are parent开发者_如何学运维ed to UITableViewCells (or their subclasses). I'm having trouble reproducing the problem consistently, which is why I haven't posted any code this time.

Has anyone encountered something similar to this before?

I've encountered a similar bug that involved floating point values for origin/size being interpreted weirdly... but that doesn't seem to be the cause of this particular problem.

I don't need a specific solution at this point, I'm just making sure I haven't missed any well-known bugs or documented problems that involve UIImageView.


I had the same problem but strangely enough only with the imageViews in the header cells. The fix in my case was to set the contentMode of the image view and everything looked the way you would expect.

imageView.contentMode = UIViewContentModeTop;


Maybe not UIImageView is the cause?

If you have an image in UITableViewCell and you don't at least 5 pixels "free space", the UITableViewCell may not look as it should be.

Try to set the rowHeight when you're initializing the table. For ex:

self.tableView.rowHeight = 60;

If this does't solve the problem, pls provide mode details.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号