|
@@ -176,7 +176,22 @@ extension KMQucikToolsView: NSCollectionViewDelegateFlowLayout {
|
|
//Collection Page
|
|
//Collection Page
|
|
extension KMQucikToolsView {
|
|
extension KMQucikToolsView {
|
|
func pageCount() -> Int {
|
|
func pageCount() -> Int {
|
|
- return Int(ceilf(Float(self.collectionView.frame.size.width / self.collectionView.visibleRect.size.width)))
|
|
|
|
|
|
+ print(self.collectionView.frame.size)
|
|
|
|
+ print(self.collectionView.visibleRect.size)
|
|
|
|
+
|
|
|
|
+ var width = 260.0
|
|
|
|
+ var count = ceilf(Float(self.data.count) * 0.5)
|
|
|
|
+ if type == .collapse {
|
|
|
|
+ width = 170
|
|
|
|
+ } else if type == .expand {
|
|
|
|
+ width = 260
|
|
|
|
+ } else {
|
|
|
|
+ width = 260
|
|
|
|
+ }
|
|
|
|
+ width = Double(count) * (width + 10)
|
|
|
|
+
|
|
|
|
+ return Int(ceilf(Float(width / self.collectionView.visibleRect.size.width)))
|
|
|
|
+// return Int(ceilf(Float(self.collectionView.frame.size.width / self.collectionView.visibleRect.size.width)))
|
|
}
|
|
}
|
|
|
|
|
|
func currentPage() -> Int {
|
|
func currentPage() -> Int {
|