Я пытаюсь отобразить адрес так, как он отображается в приложении «Контакты» на iPhone. поэтому кажется, мне нужна ячейка с высотой в три раза больше обычной ячейки. поскольку он всегда будет таким же, мне просто нужно применить фиксированную высоту к коду. но я не знаю, как это сделать. мой текущий код:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *address = [NSString stringWithFormat:@"%@\n"@"%@ %@ %@\n"@"%@", dispAddress, dispCity, dispState, dispZip, dispCountry];
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.detailTextLabel.numberOfLines = 3; // 0 means no max.
cell.detailTextLabel.text = address;
return cell;
}