pujiaxin33 / jxmovablecelltableview Goto Github PK
View Code? Open in Web Editor NEWThe custom tableView which can start moving the cell with a long press gesture.
License: MIT License
The custom tableView which can start moving the cell with a long press gesture.
License: MIT License
你好!直接下载你的demo, 添加heightForRowAtIndexPath方法 返回70 以上, cell 拖到两端就会抖动!!可以解决么?
请问怎么获取移动后的数据
cell 不能点击
你好,我不想要数据转换功能,数据我想自己处理,应该改哪里呢?
这里还会有个问题:
如果外面的数据源只有一层数组, 则只能使用_tempDataSource,
如果外面的数据源是两层数组,则需要使用_tempDataSource[fromIndexPath.section]。
所以这里还需要做好多层数据源的判断。
不同高度的cell(cell 高度超差超过100),超过一屏幕,向上拖动较低高度的cell,在tableview滚动的时候出现,滚动到高度较高cell的地方,出现不在自动滚动。一直卡在两个cell 交换的地方。
你好,能详细描述问题吗?
原始数据为012345,移动5到第一个位置后数据源应为501234,但你使用[_tempDataSource[fromIndexPath.section] exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row]所以实际变成了512340
2016-09-05 16:53:07.767 NiceArticle[5318:130720] 1
2016-09-05 16:53:20.480 NiceArticle[5318:130720] 1
2016-09-05 16:53:20.493 NiceArticle[5318:130720] 1
Printing description of toIndexPath:
<NSIndexPath: 0xc000000000800016> {length = 2, path = 0 - 4}
2016-09-05 16:56:09.784 NiceArticle[5318:130720] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[**NSArrayM exchangeObjectAtIndex:withObjectAtIndex:]: index 3 beyond bounds [0 .. 0]'
* First throw call stack:
(
0 CoreFoundation 0x000000010cf3de65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c62ddeb objc_exception_throw + 48
2 CoreFoundation 0x000000010ce83cfa -[__NSArrayM exchangeObjectAtIndex:withObjectAtIndex:] + 362
3 NiceArticle 0x000000010c120a7f -[JXMovableCellTableView jx_updateDataSourceAndCellFromIndexPath:toIndexPath:] + 191
4 NiceArticle 0x000000010c11fe77 -[JXMovableCellTableView jx_gestureChanged:] + 263
5 NiceArticle 0x000000010c120f58 -[JXMovableCellTableView jx_processEdgeScroll] + 56
6 QuartzCore 0x000000010d62aa8c _ZN2CA7Display15DisplayLinkItem8dispatchEv + 50
7 QuartzCore 0x000000010d62a956 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 418
8 CoreFoundation 0x000000010ce9dc84 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
9 CoreFoundation 0x000000010ce9d831 __CFRunLoopDoTimer + 1089
10 CoreFoundation 0x000000010ce5f241 __CFRunLoopRun + 1937
11 CoreFoundation 0x000000010ce5e828 CFRunLoopRunSpecific + 488
12 GraphicsServices 0x000000011130aad2 GSEventRunModal + 161
13 UIKit 0x000000010d749610 UIApplicationMain + 171
14 NiceArticle 0x000000010c11edcf main + 111
15 libdyld.dylib 0x000000010fad892d start + 1
16 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
indexPathForRowAtPoint 此方法无法判断移入空行
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to move both row at index path <NSIndexPath: 0xc000000000000616> {length = 2, path = 6 - 0} and <NSIndexPath: 0xc000000000000816> {length = 2, path = 8 - 0} to <NSIndexPath: 0xc000000000000716> {length = 2, path = 7 - 0}' 跟复用cell处理字符串的NSAttributedString(富文本)有关,改为异步已解决 该问题与JXMovableCellTableView无关
请问可以只拖动cell里面的一个view,来实现数据交换吗
你好 我想问一下 我从第一组 移动到 第二组 为什么 第二组的第一个数据 会自动移动到第一组的最后一个呢?
要是 从第一组移动到第二组 只是 第一组的减少 第二组 增多 这样的话 怎么操作呢
当cell的高度大于屏幕的高度时cell无法拖动,以及长按时的上移动画是否能取消掉。
当 tableView.rowHeight = UITableViewAutomaticDimension 时,cell从最下往上移动并移动到顶端,tableview会上下抖动,这个可以解决吗
- (CGFloat)limitContentOffsetY:(CGFloat)targetOffsetY {
CGFloat minContentOffsetY;
if (@available(iOS 11.0, *)) {
minContentOffsetY = -self.adjustedContentInset.top;
}
else {
minContentOffsetY = -self.contentInset.top;
}
CGFloat maxContentOffsetY = minContentOffsetY;
CGFloat contentSizeHeight = self.contentSize.height;
if (@available(iOS 11.0, *)) {
contentSizeHeight += self.adjustedContentInset.top + self.adjustedContentInset.bottom;
}
else {
contentSizeHeight += self.contentInset.top + self.contentInset.bottom;
}
if (contentSizeHeight > self.bounds.size.height) {
maxContentOffsetY += contentSizeHeight - self.bounds.size.height;
}
return MIN(maxContentOffsetY, MAX(minContentOffsetY, targetOffsetY));
}
不然在排序时,会造成奇怪的滚动
rt,当我移动到顶部的时候屏幕会出现闪烁。当我去掉自适应代码就正常了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.