Created
December 7, 2012 23:56
-
-
Save kulte/4237643 to your computer and use it in GitHub Desktop.
iOS Recipes 15-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSString *CellID = @"CustomCell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellID]; | |
if (cell == nil) { | |
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellID]; | |
UIImage *rainbow = [UIImage imageNamed:@"rainbow"]; | |
UIImageView *mainImageView = [[UIImageView alloc] initWithImage:rainbow]; | |
UIImageView *otherImageView = [[UIImageView alloc] initWithImage:rainbow]; | |
CGRect iconFrame = (CGRect) { { 12.0, 4.0 }, rainbow.size }; | |
mainImageView.frame = iconFrame; | |
iconFrame.origin.x = CGRectGetMaxX(iconFrame) + 9.0; | |
otherImageView.frame = iconFrame; | |
[cell.contentView addSubview:mainImageView]; | |
[cell.contentView addSubview:otherImageView]; | |
UILabel *label = [[UILabel alloc] initWithFrame:labelFrame]; | |
[cell.contentView addSubview:label]; | |
} | |
return cell; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment