Mickey Cheong
Mickey Cheong

Reputation: 3010

How do you change the height of the TTTableMoreButton?

Is there a way to change the height of the TTTableMoreButton without creating a new class ItemClass for TTTableMoreButton and return that class in the function

- (Class)tableView:(UITableView *)tableView cellClassForObject:(id)object

Thanks a mil. Do let me know if it is not possible.

Cheers, Mickey

Upvotes: 1

Views: 257

Answers (1)

Andrew Flynn
Andrew Flynn

Reputation: 1516

Keep in mind that you won't be changing the height of the TTTableMoreButton, but will rather be changing the height of the TTTableMoreButtonCell that is associated with the TTTableMoreButton. The correct way to do what I think you're trying to achieve is to create a subclass of both TTTableMoreButton and TTTableMoreButtonCell, override the

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

function in your TTTableMoreButtonCell subclass, and then inside of your data source, be sure to map between the two classes as you yourself mentioned like:

- (Class)tableView:(UITableView *)tableView cellClassForObject:(id)object {
  if ([object isKindOfClass:[CustomItem class]]) {
    return [CustomItemCell class];
  } else {
    return [super tableView:tableView cellClassForObject:object];
  }
}

HTH

Upvotes: 1

Related Questions