到目前为止,我试过了:
@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
没有人在工作......
答案 0 :(得分:0)
只需返回
中的实际高度 UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (something) {
return 260.0
} else {
return UITableViewAutomaticDimension;
}
}