UILabels我的自定义中有三个UITableViewCell。可能有些UILabels是空的(label.text == @"")
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"EventCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSString *key = [[keysArray objectAtIndex:indexPath.section] description];
UILabel *nameLabel = (UILabel *)[cell viewWithTag:100];
namelabel.text = @"Label 1";
UILabel *locationLabel = (UILabel *)[cell viewWithTag:101];
location.text = @"Label 2";
UILabel *timeLabel = (UILabel *)[cell viewWithTag:102];
timeLabel.text = @"";
return cell;
}
如何UILabels使用自动布局在单元格中垂直居中所有非空?
这是三个标签的样子

UILables其中一个为空时的外观

这就是我希望它看起来的样子:
