【发布时间】:2014-10-26 12:22:48
【问题描述】:
这是我目前拥有的:
在 cellForRowAtIndexPath 中
if ([userSelection isEqualToString:comparison]){
changeHeight = NO;
} else if(![userSelection isEqualToString:comparison]) {
[cell setHidden:YES];
changeHeight = YES;
}
return cell;
这里是 heightForRowAtIndexPath
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(changeHeight == YES) {
return 0;
} else return 44;
changeHeight = NO;
}
if 语句是 cellForRowAtIndexPath 完美运行,但 heightForRowAtIndexPath 中的那个不计算并且总是返回 44 - 无论 cellForRowAtIndexPath 中的相等性是否为真。
有什么想法吗?
【问题讨论】:
标签: iphone xcode uitableview if-statement cell