I use UITableViewCellStyleValue2and UITableViewStyleGrouped.
Let's start with some code (it is not 100% complete, but I tried to include the code needed to hopefully decrypt what I am doing, and possibly do it wrong):
#define CELL_FONTSIZE 15.0f
CGSize textSizeValue2 = {207.0f, 9999.0f};
if ([value isEqual: CELL_4]) {
CGSize size = [cell4String sizeWithFont:[UIFont boldSystemFontOfSize:CELL_FONTSIZE] constrainedToSize:textSizeValue2 lineBreakMode:UILineBreakModeWordWrap];
size.height += CELL_HEIGHT;
result = MAX(size.height, 44.0f);
For this particular cell, the result for height reaches 214 for both 3.0 and 3.1
Here's the code for the cell:
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.textLabel.numberOfLines = 0;
cell.detailTextLabel.numberOfLines = 0;
cell.clearsContextBeforeDrawing;
if ([value isEqual: CELL_4]) {
cell.textLabel.text = @"About";
cell.detailTextLabel.text = cell4String;
Basically, the same thing happens for 3.0 and 3.1, but when you start the application in simulator 3.0, the last line seems to be truncated if it cell.detailTextLabel.numberOfLineshas more than three lines of text. It is strange that the text is simply disabled, but the cell is drawn at the correct height of 3.0, there is just an empty space under the cell.
- , 3.0 3.1? , - Xcode, , -, 3.0, , , , - .