UITableView重新排序,如清除应用程序 [英] UITableView reorder like Clear app
本文介绍了UITableView重新排序,如清除应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
长按检测后如何开始移动?使用uilongpressgesturerecognizer进行长时间检测。
我的代码:
How to start moving after the long tap detect? long tap detect with uilongpressgesturerecognizer. My code:
`- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
flMoveRow = NO;
[self setEditing:YES animated:YES];
[listView reloadData];
}
- (void)longTapGesture:(UILongPressGestureRecognizer *)sender{
if((sender.state != UIGestureRecognizerStateEnded)&&(!flMoveRow)){
NSLog(@"==longTapGesture:");
flMoveRow = YES;
[listView beginUpdates];
NSArray *indexPaths = [[NSArray alloc] initWithObjects:indexPath, nil];
[listView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
[listView endUpdates];
sender.enabled = NO;
return;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"==canMoveRowAtIndexPath:%i -- %d", indexPath.row, (int)flMoveRow);
return flMoveRow;}`
break touch。谢谢。
break touch. Thanks.
推荐答案
cocoacontrols.com上有一个模仿Clear应用程序的控件。它仍在继续工作,但是当我下载它时,它仍然令人印象深刻。您可以将其完全合并到您的应用中,也可以将其作为您自己研究的起点。
There is a control available on cocoacontrols.com which mimics the Clear app. It is still being worked on apparently but when I downloaded it, it was still very impressive. You could either incorporate it fully in your app or use it as a starting point in your own research.
链接。
这篇关于UITableView重新排序,如清除应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文