diff --git a/AQGridView.xcodeproj/project.pbxproj b/AQGridView.xcodeproj/project.pbxproj index 0bc5741..2aaa656 100644 --- a/AQGridView.xcodeproj/project.pbxproj +++ b/AQGridView.xcodeproj/project.pbxproj @@ -331,6 +331,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 3.0; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -345,6 +346,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 3.0; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/AQGridView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AQGridView.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 57294f7..02ba8a1 100644 --- a/AQGridView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/AQGridView.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -1,15 +1,7 @@ - + - - - - - - diff --git a/Classes/AQGridView.m b/Classes/AQGridView.m index 134a109..fca3a66 100755 --- a/Classes/AQGridView.m +++ b/Classes/AQGridView.m @@ -88,6 +88,8 @@ - (void) deleteVisibleCell: (AQGridViewCell *) cell atIndex: (NSUInteger) visibl @interface AQGridView () @property (nonatomic, copy) NSIndexSet * animatingIndices; +- (void) cellUpdateAnimationStopped: (NSString *) animationID finished: (BOOL) finished context: (void *) context; +- (void) handleGridViewBoundsChanged: (CGRect) oldBounds toNewBounds: (CGRect) bounds; @end @@ -356,6 +358,9 @@ - (void) setGridHeaderView: (UIView *) newHeaderView [_headerView removeFromSuperview]; _headerView = newHeaderView; + + CGFloat oldHeight = _gridData.topPadding; + if ( _headerView == nil ) { _gridData.topPadding = 0.0; @@ -366,6 +371,10 @@ - (void) setGridHeaderView: (UIView *) newHeaderView _gridData.topPadding = _headerView.frame.size.height; } + if ( _gridData.topPadding != oldHeight ) + { + [self handleGridViewBoundsChanged:self.bounds toNewBounds:self.bounds]; + } [self setNeedsLayout]; } @@ -382,6 +391,8 @@ - (void) setGridFooterView: (UIView *) newFooterView [_footerView removeFromSuperview]; _footerView = newFooterView; + + CGFloat oldHeight = _gridData.bottomPadding; if ( _footerView == nil ) { _gridData.bottomPadding = 0.0; @@ -392,6 +403,9 @@ - (void) setGridFooterView: (UIView *) newFooterView _gridData.bottomPadding = _footerView.frame.size.height; } + if ( _gridData.bottomPadding != oldHeight ) { + [self handleGridViewBoundsChanged:self.bounds toNewBounds:self.bounds]; + } [self setNeedsLayout]; } @@ -653,6 +667,14 @@ - (void) layoutSubviews if ( (_flags.needsReload == 1) && (_animationCount == 0) && (_reloadingSuspendedCount == 0) ) [self reloadData]; + if ( (_headerView && _gridData.topPadding != _headerView.frame.size.height ) || + (_footerView && _gridData.bottomPadding != _footerView.frame.size.height) ) + { + _gridData.topPadding = _headerView.frame.size.height; + _gridData.bottomPadding = _footerView.frame.size.height; + [self handleGridViewBoundsChanged:self.bounds toNewBounds:self.bounds]; + } + if ( (_reloadingSuspendedCount == 0) && (!CGRectIsEmpty([self gridViewVisibleBounds])) ) { [self updateVisibleGridCellsNow]; @@ -1714,8 +1736,9 @@ - (void) updateVisibleGridCellsNow [self layoutAllCells]; } } - @catch (id exception) + @catch (__autoreleasing NSException *exception) { + // do nothing } @finally {