小编Sas*_*ent的帖子

如何获取位于UICollectionView中心的单元格的indexPath

我如何才能找到indexPath用于cell在中间UICollectionView

我有水平滚动,只有一个大cell的可见(cell两侧的其他部分也是可见的).我需要删除cell位于中心(手段 - 当前cell)而不触摸它.

只需按"废纸篓"按钮并确认删除.但现在它只删除了第一个cells.

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    if (buttonIndex == actionSheet.destructiveButtonIndex) { 
        initialPinchPoint = ????????

        self.tappedCellPath = [self.collectionView indexPathForItemAtPoint:initialPinchPoint];

        Technique *technique = [arrayOfTechnique objectAtIndex:self.tappedCellPath.row];

        [self deleteData:[NSString stringWithFormat:@"DELETE FROM TECHNIQUES WHERE TECHNIQUENAME IS '%s'",[technique.techniquename UTF8String]]];

        [arrayOfTechnique removeObjectAtIndex:self.tappedCellPath.row];

        //[arrayOfTechnique removeObjectAtIndex:[custom_layout ]];
        [self removeImage:technique.techniquename];

        [self.collectionView performBatchUpdates:^{
            [self.collectionView deleteItemsAtIndexPaths:[NSArrayarrayWithObject:self.tappedCellPath]];
         } completion:nil];

         [self checkArrayCount];
    }
}
Run Code Online (Sandbox Code Playgroud)

ios uicollectionview uicollectionviewcell

49
推荐指数
6
解决办法
4万
查看次数

如何使用Core Graphics绘制箭头?

我需要在Draw应用程序的末尾用箭头绘制线条.我不擅长三角学,所以无法解决这个问题.

用户将手指放在屏幕上并沿任何方向画线.因此,箭头应出现在行尾.

core-graphics objective-c quartz-2d ios

36
推荐指数
3
解决办法
2万
查看次数