我对 UITableViewCell 中的 UILabel 有奇怪的问题。直到我拉下屏幕以使 UITableViewCell 位于顶部时它才会出现。这是该问题的视频。
这是创建单元格时的代码。
    TVC_Location_View_Text *cell = (TVC_Location_View_Text *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TVC_Location_View_Text" owner:nil options: nil];
        for(id currentObject in topLevelObjects) {
            if([currentObject isKindOfClass:[UITableViewCell class]]) {
                cell = ((TVC_Location_View_Text *) currentObject);
                break;
            }
        }
    }
    UIFont *cellFont = [UIFont fontWithName:@"Helvetica" size:15.0];
    CGSize constraintSize = CGSizeMake(300.0f, MAXFLOAT);
    CGSize labelSize = [self.sLocationText sizeWithFont:cellFont constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];
    CGRect rect = CGRectMake(10, 10,  labelSize.width, labelSize.height);
    UILabel* labelText = [[UILabel alloc] initWithFrame:rect];
    [labelText setFont:cellFont];
    [labelText setLineBreakMode:UILineBreakModeWordWrap];
    [labelText setNumberOfLines:0];
    [labelText setBackgroundColor:[UIColor clearColor]];
    [labelText setTextColor:appDelegate.colorDarkText];
    [cell addSubview:labelText];
    [labelText setText:self.sLocationText];
    return cell;