UITableViewCell の UILabel に奇妙な問題があります。UITableViewCell が一番上になるように画面を下に引っ張るまで表示されません。これが問題のビデオです。
HEreは、セルが作成されたときのコードです。
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;