1

I have a UITableView where each cell uses Core Text to draw some text. When calculating the height to return for heightForRow, I use NSString sizeWithFont to determine the height of the cell. However, in my Core Text drawing, I'm increasing the space between every line by a few decimals.

The question is, how can I make up for this in my heightForRow method sizeWithFont to also factor in line spacing besides the default font line spacing?

4

1 に答える 1

3

Core Textを使用してテキストを描画している場合は、CoreTextを使用してテキストの高さを計算する必要があります。関数をチェックしてくださいCTFramesetterSuggestFrameSizeWithConstraints

于 2012-05-13T17:48:25.127 に答える