pljhonglu / lewreorderablelayout Goto Github PK
View Code? Open in Web Editor NEWA UICollectionView layout whitch can move item with drag and drop.
License: MIT License
A UICollectionView layout whitch can move item with drag and drop.
License: MIT License
in iOS 11, dragging a cell to the top or bottom will not fully move the scrollview towards the end.
如果某一行没有填满, 那么想要拖动整个view则会被gesture的delegate阻止掉, 导致这一部分拖动事件无法响应, 例如, 大图这一行个数的单数的情况下, 拖动右边的空白区域是无效的.
建议:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
if ([_panGesture isEqual:gestureRecognizer]) {
if ([_longPress isEqual:otherGestureRecognizer]) {
return YES;
}else{
// 这里原来直接返回NO, 可以根据是否选中了cell来判断
CGPoint location = [gestureRecognizer locationInView:self.collectionView];
return ![self.collectionView indexPathForItemAtPoint:location];
}
....
}
如题
RT
As delegate methods are optional, please add comments with default value (if not implemented) to interface
如果某个section下的cell数量为0,就无法移动Cell到该section下
看了代码是直在canMove里面返回了NO, 但是这样一来的话, 会导致既不能往下移, 也不能往上移了. 建议添加一个delegate方法来获取是否需要继续移动的操作. 在longPressBegan的case里面先检查这个
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.