Skip to content

Commit

Permalink
Merge pull request #50 from pierrephi/master
Browse files Browse the repository at this point in the history
Fix for cells w/o accessory view [iOS7]
  • Loading branch information
Tim Davies committed Mar 12, 2014
2 parents a9070e2 + ffcc6f8 commit ac9b231
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions TDBadgedCell (xcode project)/TDBadgedCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,8 @@ - (void)configureSelf
self.badge.parent = self;


#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
self.badgeLeftOffset = 10.f;
self.badgeRightOffset = 0;
#else
self.badgeLeftOffset = 10.f;
self.badgeRightOffset = 12.f;
#endif


// by default, resize textLabel & detailTextLabel
self.resizeableLabels = [NSMutableArray arrayWithCapacity:2];
Expand Down Expand Up @@ -266,7 +260,15 @@ - (void) layoutSubviews
else
[self.badge setHidden:NO];


#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
if (self.accessoryType != UITableViewCellAccessoryNone) {

self.badgeRightOffset = 0.f;
} else {

self.badgeRightOffset = 12.f;
}
#endif
// Calculate the size of the bage from the badge string
UIFont *font = self.badge.boldFont ? [UIFont boldSystemFontOfSize:self.badge.fontSize] : [UIFont systemFontOfSize:self.badge.fontSize];
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
Expand Down

0 comments on commit ac9b231

Please sign in to comment.