Skip to content

Commit

Permalink
[Example] text sizing style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jhersh committed Jan 3, 2015
1 parent 6692322 commit de282c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Example/AttributedTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ + (CGFloat)heightForCellWithText:(NSString *)text availableWidth:(CGFloat)availa
static CGFloat padding = 10.0;

UIFont *systemFont = [UIFont systemFontOfSize:kEspressoDescriptionTextFontSize];
CGSize textSize = CGSizeMake(availableWidth - (2 * padding), CGFLOAT_MAX);
CGSize textSize = CGSizeMake(availableWidth - (2 * padding) - 26, CGFLOAT_MAX); // rough accessory size
CGSize sizeWithFont = [text sizeWithFont:systemFont constrainedToSize:textSize lineBreakMode:NSLineBreakByWordWrapping];

#if defined(__LP64__) && __LP64__
Expand Down
2 changes: 1 addition & 1 deletion Example/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ - (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(__unused NSIndexPath *)indexPath
{
return [AttributedTableViewCell heightForCellWithText:[self.espressos objectAtIndex:(NSUInteger)indexPath.row]
availableWidth:CGRectGetWidth(tableView.frame) - 26]; // rough accessory size
availableWidth:CGRectGetWidth(tableView.frame)];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
Expand Down

0 comments on commit de282c3

Please sign in to comment.