我已将图像添加到UICollectionView
中单元格的左上角。但是图像被添加到单元格的内侧而不是单元格的外侧。请告诉我如何添加图像到单元格的外侧。下面是我实现的代码。
UIButton *delButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, delButtonSize, delButtonSize)];
delButton.center = CGPointMake(9, 10);
delButton.backgroundColor = [UIColor clearColor];
[delButton setImage: [UIImage imageNamed:@"cross_30.png"] forState:UIControlStateNormal];
[cell addSubview:delButton];
[delButton addTarget:self action:@selector(deleteRecipe:) forControlEvents:UIControlEventTouchUpInside];
但我想要这样