Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImage bigger than custom UITableViewCell

I have an UITableView with an custom UITableViewCell. In the cell, for style purposes, I have an UIImage that is much bigger than my custom cell, and what happens is that the image isn't cropped and it employs the other cells. Is there a way or a property to aviod this behaviour? Thank you.

I'm not native english, for that reason I post this picture. https://i.sstatic.net/E4mUN.jpg

like image 791
Pradas Avatar asked Jul 13 '26 10:07

Pradas


1 Answers

In cellForRowAtIndexPath: method of table view data source, do cell.clipsToBounds = YES

like image 68
folex Avatar answered Jul 15 '26 00:07

folex