Skip to content
Browse files

Updated SSCollectionViewItem default sizing

  • Loading branch information...
1 parent f51a45f commit a541bc731b1cda09e493fcd772de8b7d1f34deb1 @soffes soffes committed Oct 9, 2011
Showing with 14 additions and 5 deletions.
  1. +7 −2 SSCatalog/Classes/SCImageCollectionViewItem.m
  2. +7 −3 SSToolkit/SSCollectionViewItem.m
View
9 SSCatalog/Classes/SCImageCollectionViewItem.m
@@ -16,10 +16,15 @@ @implementation SCImageCollectionViewItem
@synthesize imageURL = _imageURL;
- (void)setImageURL:(NSURL *)url {
+ [url retain];
[_imageURL release];
- _imageURL = [url retain];
+ _imageURL = url;
- [self.imageView setImageWithURL:url placeholderImage:nil];
+ if (_imageURL) {
+ [self.imageView setImageWithURL:url placeholderImage:nil];
+ } else {
+ self.imageView.image = nil;
+ }
}
View
10 SSToolkit/SSCollectionViewItem.m
@@ -111,6 +111,8 @@ - (void)layoutSubviews {
if (_style == SSCollectionViewItemStyleImage) {
_imageView.frame = self.bounds;
+ } else if (_style == SSCollectionViewItemStyleDefault) {
+ _textLabel.frame = self.bounds;
}
}
@@ -123,9 +125,11 @@ - (id)initWithStyle:(SSCollectionViewItemStyle)style reuseIdentifier:(NSString *
_reuseIdentifier = [aReuseIdentifier copy];
if (_style != SSCollectionViewItemStyleBlank) {
- _detailTextLabel = [[SSLabel alloc] initWithFrame:CGRectZero];
- _detailTextLabel.textAlignment = UITextAlignmentCenter;
- [self addSubview:_detailTextLabel];
+ if (_style == SSCollectionViewItemStyleSubtitle) {
+ _detailTextLabel = [[SSLabel alloc] initWithFrame:CGRectZero];
+ _detailTextLabel.textAlignment = UITextAlignmentCenter;
+ [self addSubview:_detailTextLabel];
+ }
_textLabel = [[SSLabel alloc] initWithFrame:CGRectZero];
_textLabel.textAlignment = UITextAlignmentCenter;

0 comments on commit a541bc7

Please sign in to comment.
Something went wrong with that request. Please try again.