I need to create a UICollectionViewCell user interface to show the image and name for the image. And on top of the image there is a frame image that is 2 pixels wider in width and height than the image. However, no matter what I do, the image seems larger than the image frame. I did the same to represent the table and it works great.
Here is the code:
//GridCell.h @interface GridCell : UICollectionViewCell @property(nonatomic, strong) UILabel *lblName; @property(nonatomic, strong) UIImageView *image; @end //GridCell.m
UICollectionViewCell has a size of 67 x 100, so in the bgImage code should always be 67 x 67, and its beginning should be (0,0), and the contentImage should have a frame (0, 0.63.63). By debugging, this seems right. However, conentimage is always more than bgImage. The original image size is 80 x 80. I tried setClipToBounds, setContentViewMode in either cell.ContentView or the image, but no one works.
A screenshot of the problem is attached. 
Any help is appreciated.
source share