Permalink
Browse files

[UI] substract sectionindex size when calculating cell height

  • Loading branch information...
1 parent 338ef3d commit 6cb05895c5a6a10ac4a604a41385dd3f552479e4 @diederich diederich committed Feb 24, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/Three20UI/Sources/TTTableTextItemCell.m
@@ -82,6 +82,12 @@ + (CGFloat)tableView:(UITableView*)tableView rowHeightForObject:(id)object {
TTTableTextItem* item = object;
CGFloat width = tableView.width - (kTableCellHPadding*2 + [tableView tableCellMargin]*2);
+
+ if([tableView.dataSource respondsToSelector:@selector(sectionIndexTitlesForTableView:)] &&
+ nil != [tableView.dataSource sectionIndexTitlesForTableView:tableView]) {
+ width -= 10.f;
@jverkoey
jverkoey Feb 25, 2011 Contributor

Can we make this a constant?

+ }
+
UIFont* font = [self textFontForItem:item];
CGSize size = [item.text sizeWithFont:font
constrainedToSize:CGSizeMake(width, CGFLOAT_MAX)

0 comments on commit 6cb0589

Please sign in to comment.