Permalink
Browse files

Reload if needed (e.g. orientation changes)

  • Loading branch information...
1 parent 739e284 commit 12180b17fa082786fac543bddd206ed69670d6b7 @renspr renspr committed Jun 27, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 MMGridView/Classes/MMGridView.m
@@ -74,6 +74,12 @@ - (id)initWithCoder:(NSCoder *)aDecoder
}
+- (void)layoutSubviews
+{
+ [self reloadData];
+}
+
+
- (void)createSubviews
{
cellMargin = 3;
@@ -142,7 +148,7 @@ - (void)reloadData
[v removeFromSuperview];
}
- if (self.dataSource) {
+ if (self.dataSource && self.numberOfRows > 0 && self.numberOfColumns > 0) {
NSInteger noOfCols = self.numberOfColumns;
NSInteger noOfRows = self.numberOfRows;
NSUInteger cellsPerPage = self.numberOfColumns * self.numberOfRows;

0 comments on commit 12180b1

Please sign in to comment.