作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试像在 AnyDo 应用程序中一样在滑动时实现表格 View 单元格删除。任何帮助???
我的代码:
我正在使用手势识别器
- (UISwipeGestureRecognizer *)swipeRightRecognizer
{
if (!_swipeRightRecognizer)
{
_swipeRightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
_swipeRightRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
}
return _swipeRightRecognizer;
}
[cell.contentView addGestureRecognizer:self.leftGestureRecognizer];
- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer indexPath: (NSIndexPath *)index
{
if (recognizer.direction == UISwipeGestureRecognizerDirectionLeft)
{
//Table View deletion code. + Line to be drawn on cell, move that cell to the bottom of the table with animaiton.
}
最佳答案
Colin Eberhardt 在 How to Make a Gesture-Driven To-Do List App Like Clear 上写了一篇很棒的教程.还实现了滑动删除功能。
关于ios - "AnyDo"滑动删除动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15022356/
我正在尝试像在 AnyDo 应用程序中一样在滑动时实现表格 View 单元格删除。任何帮助??? 我的代码: 我正在使用手势识别器 - (UISwipeGestureRecognizer
我是一名优秀的程序员,十分优秀!