Noam
Noam

Reputation: 3391

Three20 TTTableViewController cell height

I'm trying to change the height of the cells in my TTTableViewController from the three20 library. I'm using TTTableRightImageItem and I want the height to be determined by the height of the image and not the fixed height.

Do I have to subclass TableCell? Is there a property I can just set?

Upvotes: 2

Views: 1281

Answers (3)

FlorentB
FlorentB

Reputation: 1

Make sure that the UITableViewDelegate that you create in the - (id<UITableViewDelegate>)createDelegate method of TTTableViewController is a subclass of TTTableViewVarHeightDelegate.

A simple TTTableViewDelegate won't call the + (CGFloat)tableView:(UITableView*) tableView rowHeightForObject:(id)item; method of your custom cell.

Upvotes: 0

mobius
mobius

Reputation: 5174

Although probably late, but for anyone else searching set:

self.variableHeightRows = YES; 

on your TTTableViewController and subclass the TTTableRightImageItem to implement

+ (CGFloat)tableView:(UITableView*) tableView rowHeightForObject:(id)item; 

and return the cell height in float.

Upvotes: 1

Michael Grinich
Michael Grinich

Reputation: 4780

You'll need to subclass.

Upvotes: 1

Related Questions