Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: soffes/sstoolkit
...
head fork: RedMadRobot/sstoolkit
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Nov 28, 2011
Andrey Zarembo Добавлен вывод картинки и текста одновременно 8371738
Commits on Jan 22, 2012
Andrey Zarembo Поправка, чтобы большой проект собирался в ipa
И добавлена работа с ReuseIdentifier в SSCollectionView
11590a0
View
11 SSToolkit/SSCollectionViewItem.h
@@ -13,7 +13,8 @@ typedef enum {
SSCollectionViewItemStyleDefault = UITableViewCellStyleDefault,
SSCollectionViewItemStyleSubtitle = UITableViewCellStyleSubtitle,
SSCollectionViewItemStyleBlank,
- SSCollectionViewItemStyleImage
+ SSCollectionViewItemStyleImage,
+ SSCollectionViewItemStyleImageWithLabel
} SSCollectionViewItemStyle;
@class SSLabel;
@@ -22,7 +23,9 @@ typedef enum {
/**
View for display in a collection view.
*/
-@interface SSCollectionViewItem : UIView
+@interface SSCollectionViewItem : UIView {
+ NSString* _reuseIdentifier;
+}
/**
Returns the image view of the collection view item. (read-only)
@@ -101,6 +104,9 @@ typedef enum {
*/
@property (nonatomic, getter=isHighlighted) BOOL highlighted;
+
+@property (nonatomic) CGSize imageSize;
+
/**
Initializes a collection view item with a style and a reuse identifier and returns it to the caller.
@@ -151,4 +157,5 @@ typedef enum {
*/
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;
+
@end
View
6 SSToolkit/SSCollectionViewItem.m
@@ -32,6 +32,7 @@ @implementation SSCollectionViewItem {
@synthesize highlighted = _highlighted;
@synthesize indexPath = _indexPath;
@synthesize collectionView = _collectionView;
+@synthesize imageSize;
- (void)setBackgroundView:(UIView *)backgroundView {
[backgroundView retain];
@@ -113,7 +114,10 @@ - (void)layoutSubviews {
_imageView.frame = self.bounds;
} else if (_style == SSCollectionViewItemStyleDefault) {
_textLabel.frame = self.bounds;
- }
+ } else if (_style == SSCollectionViewItemStyleImageWithLabel) {
+ _imageView.frame = CGRectMake( (self.bounds.size.width-self.imageSize.width)/2 , 0, self.imageSize.width, self.imageSize.height );
+ _textLabel.frame = CGRectMake(0, self.imageSize.height+2, self.bounds.size.width, self.bounds.size.height-self.imageSize.height+2);
+ }
}

No commit comments for this range

Something went wrong with that request. Please try again.