1

到目前为止,我尝试过:

@IBOutlet weak var requestDateButtonBottomConstraint: NSLayoutConstraint!

requestDateButtonBottomConstraint.constant = sender.selected ? 0 : 260

我也尝试过框架方法:

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

没有人在工作...

4

1 回答 1

0

只返回实际高度

UITableViewDelegate

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

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (something) {
        return 260.0
    } else {
        return UITableViewAutomaticDimension;
    }
}
于 2015-08-05T07:58:19.897 回答