iOSアプリに問題があり、UITableViewCellのUILabelをラップします。テキストは表示されますが、1行にしか表示されません。
これが私のコードです:
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
UILabel *noteLabel = (UILabel *)[cell.contentView viewWithTag:2];
NSDictionary *contact = [jsonResults objectAtIndex:indexPath.row];
noteLabel.lineBreakMode = UILineBreakModeWordWrap;
noteLabel.numberOfLines = 0;
noteLabel.text = [contact objectForKey:@"note"];
return cell;
}
問題はこの行に関係していると思います。
UILabel *noteLabel = (UILabel *)[cell.contentView viewWithTag:2];
タグからラベルを取得する他の方法がわかりません。この行では、ラベルのプロパティを変更できないと思います。