我的应用程序中有一个照片库。我可以在其中选择多张照片并删除它们。一切进展顺利。
正如我们在相机胶卷中看到的那样,我只需要实现苹果的默认选择行为。

现在我的选择是这样的

我已经实现了 didSelectItemAtIndexPath 方法如下 -
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"Delegate cell %@ : SELECTED", [self formatIndexPath:indexPath]);
    MyCustomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
    cell.label.backgroundColor=[UIColor greenColor];
}
 - (NSString *)formatIndexPath:(NSIndexPath *)indexPath 
{
    return [NSString stringWithFormat:@"%ld", (long)indexPath.row+1];
}
在 MyCustomCell.m 中,我将标签的框架设置为矩形,如图(绿色)所示。
方法 setSelected 如下所示:
- (void)setSelected:(BOOL)selected
{
    UIView *blurView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 60, 70)];
    blurView.backgroundColor=[UIColor whiteColor];
    blurView.alpha=0.5;
    blurView.opaque=YES;
    if (selected) {
        self.label.backgroundColor = [UIColor greenColor];
        [self.imageThumb addSubview:blurView];
    }
}
那么,是否有可能拥有苹果的默认选择行为?
任何帮助将不胜感激。提前致谢。