将项目从 UITableView 拖放到 UITableView
我知道 stackoverflow 上有很多关于拖动和拖放的线程。在两个 UITableView 之间放置,但我无法顺利处理它。
请不要在此线程中发布该 stackoverflow 的链接作为参考,因为我已经完成了该操作。
所以....
我创建了一个主UIViewController,在其中添加了两个UITableView,即tableView1、tableView2
,在其中添加了customCell 和UIView,并在该单元格上包含图像。现在,如果我使用 TouchMoved 委托,它对我来说根本不起作用。相反,我有像这样的手势识别器:
//Custom cell for planned spend details progress bars....
- (void) customCell:(UITableViewCell *)cell {
UIView *progressView = [[UIView alloc]initWithFrame:CGRectMake(2.0, 2.0, 320.0, 97.0)];
[self setProgressBars:progressView];
progressView.userInteractionEnabled=YES;
[self addGestureRecognizersToView:progressView];
[cell.contentView addSubview:progressView];
cell.selectionStyle=UITableViewCellSelectionStyleNone;
[progressView release];
}
setProgressBars 是我添加 UIImageView 的方法。
现在使用 UIRotationGestureRecognizer 我可以在单个 UITableView 中拖放 UIImageView。如果我将拖动到 UITableView 的范围之外,它根本不起作用。
请帮助解决我的问题,以便我能够将项目从一个 UITableView 拖动到另一个 UITableView
I know there are number of threads available on stackoverflow regarding drag & drop between two UITableView but I am not able to work on it smoothly.
Please do not post links of that stackoverflow as a refrence here in this thread because I have already gone through that.
So....
I have created a main UIViewController under which I have added two UITableView i.e. tableView1, tableView2
Under which I have added customCell and UIView enclosed with images on that cell. Now if i will use touchesMoved delegate its not working at all for me. Instead of I have gesture recognizer like so:
//Custom cell for planned spend details progress bars....
- (void) customCell:(UITableViewCell *)cell {
UIView *progressView = [[UIView alloc]initWithFrame:CGRectMake(2.0, 2.0, 320.0, 97.0)];
[self setProgressBars:progressView];
progressView.userInteractionEnabled=YES;
[self addGestureRecognizersToView:progressView];
[cell.contentView addSubview:progressView];
cell.selectionStyle=UITableViewCellSelectionStyleNone;
[progressView release];
}
setProgressBars is a method where I have added UIImageView.
Now using UIRotationGestureRecognizer I am able to drag and drop UIImageViews within single UITableView. Its not working at all If I will drag outside the premises of that UITableView.
Please help in order to resolve my problem so that I am able to drag items from one UITableView to another
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有一些工作代码:如何在表之间复制单元格作为脉冲应用程序,但动画很糟糕。如果有兴趣,我们可以联手将其作为开源发布...
更新:到目前为止我的进展:https://bitbucket.org/elmalabarista/dragdroptableviews
I have some working code: How to copy cells between tables as the pulse app, but the animation is crap. If interested, we can join forces and release it as open source...
UPDATE: My progress so far: https://bitbucket.org/elmalabarista/dragdroptableviews