From d37752f7a2bbd8901a304b9642d8f832a3273198 Mon Sep 17 00:00:00 2001 From: wikimo Date: Thu, 5 Mar 2015 15:44:59 +0800 Subject: [PATCH 1/2] [wikimo] fix if collectionView numberOfItemsInSection > 10 or numberOfItemsInSection / 2 != 0 --- .DS_Store | Bin 0 -> 6148 bytes JSDropDownMenu/JSDropDownMenu.m | 4 +++- JSDropDownMenuDemo/.DS_Store | Bin 0 -> 6148 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 JSDropDownMenuDemo/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b21b876910b6ab0fcbde938cf2d2156b7b077528 GIT binary patch literal 6148 zcmeHKyG{c!5S%3`A|auOiqgNpA6U`RAf?I=pgg*O5m7{Y9ly=&BZA04Ndddkdd}+| z`)&&FEdW^@x3|C?z>KblHywJ@b@k3JBBCg^N5eA)G`!-e%l zbj2DtI@;C2!CC;~lwmVITQ5N@8X(rd(UB3FIF;yBi55eg&UlHu8aO&S9bzYQpEy~f zLlHZj@nY$a>X>6HkP4hDF!AYJ>;E17oBsctl(SSI75GyM$aGi@3w~16*6!o9))x8$ s{bbCwbPiUEiB^g^(NcW#DX-`=*K6SDXmrMnPRt(x)g>(z_zeZ#0nOeZPyhe` literal 0 HcmV?d00001 diff --git a/JSDropDownMenu/JSDropDownMenu.m b/JSDropDownMenu/JSDropDownMenu.m index 61c0fbf..a7404e5 100644 --- a/JSDropDownMenu/JSDropDownMenu.m +++ b/JSDropDownMenu/JSDropDownMenu.m @@ -676,7 +676,9 @@ - (void)animateCollectionView:(UICollectionView *)collectionView show:(BOOL)show collectionView.frame = CGRectMake(_origin.x, self.frame.origin.y + self.frame.size.height, self.frame.size.width, 0); [self.superview addSubview:collectionView]; - collectionViewHeight = ([collectionView numberOfItemsInSection:0] > 10) ? (5 * 38) : (ceil([collectionView numberOfItemsInSection:0]/2) * 38); +// collectionViewHeight = ([collectionView numberOfItemsInSection:0] > 10) ? (5 * 38) : (ceil([collectionView numberOfItemsInSection:0]/2) * 38); + // fix if collectionView numberOfItemsInSection > 10 or numberOfItemsInSection / 2 != 0 + collectionViewHeight =ceil((CGFloat)[collectionView numberOfItemsInSection:0]/2.0) * 38; } [UIView animateWithDuration:0.2 animations:^{ diff --git a/JSDropDownMenuDemo/.DS_Store b/JSDropDownMenuDemo/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..28898e0a3403db73323284e05ebc8eca6e249d66 GIT binary patch literal 6148 zcmeHK!AitH41KfiVa3ZHJt)i<2>S=aQZIt1{(#Ufidb93qR09n;&1pF`bWM@!s=4J zsEA4e$(zX})6N@c8USJ0*9%|{U`7?3Y}33WvMxH3iFu~PkoRcOp+JipT#lmM@f#VC zyW7JNO5WQQZ|?Q}jv-sYFc;)?x%rr$1U;G8_~&9l@H9U{4O#p@jT& z?jLhFLQ-_=3^)Uu3~cFiF7^NL Date: Thu, 5 Mar 2015 15:45:44 +0800 Subject: [PATCH 2/2] [wikimo] fix if collectionView numberOfItemsInSection > 10 or numberOfItemsInSection / 2 != 0 --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + JSDropDownMenuDemo/.DS_Store | Bin 6148 -> 0 bytes 3 files changed, 1 insertion(+) delete mode 100644 .DS_Store delete mode 100644 JSDropDownMenuDemo/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index b21b876910b6ab0fcbde938cf2d2156b7b077528..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c!5S%3`A|auOiqgNpA6U`RAf?I=pgg*O5m7{Y9ly=&BZA04Ndddkdd}+| z`)&&FEdW^@x3|C?z>KblHywJ@b@k3JBBCg^N5eA)G`!-e%l zbj2DtI@;C2!CC;~lwmVITQ5N@8X(rd(UB3FIF;yBi55eg&UlHu8aO&S9bzYQpEy~f zLlHZj@nY$a>X>6HkP4hDF!AYJ>;E17oBsctl(SSI75GyM$aGi@3w~16*6!o9))x8$ s{bbCwbPiUEiB^g^(NcW#DX-`=*K6SDXmrMnPRt(x)g>(z_zeZ#0nOeZPyhe` diff --git a/.gitignore b/.gitignore index a3cd143..4535251 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ DerivedData # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # # Pods/ +.DS_Store diff --git a/JSDropDownMenuDemo/.DS_Store b/JSDropDownMenuDemo/.DS_Store deleted file mode 100644 index 28898e0a3403db73323284e05ebc8eca6e249d66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AitH41KfiVa3ZHJt)i<2>S=aQZIt1{(#Ufidb93qR09n;&1pF`bWM@!s=4J zsEA4e$(zX})6N@c8USJ0*9%|{U`7?3Y}33WvMxH3iFu~PkoRcOp+JipT#lmM@f#VC zyW7JNO5WQQZ|?Q}jv-sYFc;)?x%rr$1U;G8_~&9l@H9U{4O#p@jT& z?jLhFLQ-_=3^)Uu3~cFiF7^NL