View table with minimum height

I have a project that targets iOS7 / 8. On iOS7, I do my cell height calculations manually; on iOS8, I let the system do the math.

The cell basically contains two labels with a vertical wall, the name and description, which are to the left of the two types of decoration that are not affected by my problem.

I am trying to get all the cells so that they are displayed with a height of 60 points, and when they are involved, they are not truncated in full size. This works in most cases. There is an edge where the title and description are not actually truncated. Tapping on a cell on iOS8 in this case reduces it to just the tiniest, annoying bit.

I am wondering if there is a way to set a minimum height for a table cell, in addition to setting an estimated row height for my autosave table in iOS 8?

Hope this makes sense, let me know if I need a better explanation. Any help is appreciated in how I can set a minimum height for authorized iOS 8 cells.

Common case - truncated title and description / extended when clicked

Truncate title / descriptionExpanded title / description

The case with the edge - nothing is truncated / expanded when the button is pressed, it actually squeezes the cell

Nothing truncatedNothing truncated expanded

My heightForRowAtIndexPathreturns UITableViewAutomaticDimensionon iOS 8 and calculates it on iOS7 using a measuring cell. I also encoded the property rowHeighton 60.0f, my expected minimum height, which corresponds to what is laid out in IB.

, , . [tableView beginUpdates].

- (void) setIsExpanded:(BOOL)isExpanded {
    _isExpanded = isExpanded;

    if (_isExpanded) {
        [_descriptionText setLineBreakMode:NSLineBreakByWordWrapping];
        [_descriptionText setNumberOfLines:0];

        [_title setLineBreakMode:NSLineBreakByWordWrapping];
        [_title setNumberOfLines:0];
    } else {
        [_descriptionText setLineBreakMode:NSLineBreakByTruncatingTail];
        [_descriptionText setNumberOfLines:1];

        [_title setLineBreakMode:NSLineBreakByTruncatingTail];
        [_title setNumberOfLines:1];
    }

    [self layoutIfNeeded];
}
+4
1

:

. , , .

, , UITableViewCell height >= 60.0

, .

+22

All Articles