1

So far I tried:

@IBOutlet weak var requestDateButtonBottomConstraint: NSLayoutConstraint!

requestDateButtonBottomConstraint.constant = sender.selected ? 0 : 260

I also tried frame approach:

var cellFrame = self.frame
cellFrame.size.height = sender.selected ? 44 : 260
self.frame = cellFrame

No one is working...

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
  • You should take a look at this topic: http://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights almost everything is covered here about dynamic `UITableViewCell` height. – Dániel Nagy Aug 05 '15 at 07:54
  • So you want to change something INSIDE your cell to the size of your cell, calculated with UITableViewAutomaticDimension? – derdida Aug 05 '15 at 08:06
  • yes, this is exactly what I need – Bartłomiej Semańczyk Aug 05 '15 at 08:34

1 Answers1

0

just return actual height in

UITableViewDelegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (something) {
        return 260.0
    } else {
        return UITableViewAutomaticDimension;
    }
}
Vitalii Gozhenko
  • 9,220
  • 2
  • 48
  • 66