UILabels私の習慣には3つあります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自動レイアウトを使用して、空でないすべてのセルを垂直方向に中央揃えにするにはどうすればよいですか?
これは、3つのラベルでどのように見えるかです

いずれかUILablesが空の場合の外観

そして、これは私がそれをどのように見せたいかです:
