|
@@ -29,6 +29,7 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
|
|
|
|
|
|
listLayout = ListLayout(itemHeight: 60)
|
|
|
gridLayout = GridLayout(numberOfColumns: 5)
|
|
|
+
|
|
|
collectionView.collectionViewLayout = gridLayout
|
|
|
}
|
|
|
|
|
@@ -210,6 +211,10 @@ class ListLayout: UICollectionViewFlowLayout {
|
|
|
super.itemSize = newValue
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint {
|
|
|
+ return proposedContentOffset
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class GridLayout: UICollectionViewFlowLayout {
|
|
@@ -245,4 +250,8 @@ class GridLayout: UICollectionViewFlowLayout {
|
|
|
super.itemSize = newValue
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint {
|
|
|
+ return proposedContentOffset
|
|
|
+ }
|
|
|
}
|