I want to split a NSString
into several lines with different width, I find this method [NSString sizeWithFont:forWidth:lineBreakMode:]
in the doc,but it doesn't provide the position
where the linebreak take place. Is there any method in IOS that works like the following in Symbian:
class CFont :
TextCount()
IMPORT_C TInt TextCount(const TDesC &aText, TInt aWidthInPixels) const;
Description Gets how much of the specified descriptor can be displayed in this font without exceeding the specified width.
Note:
This function does not display any of the descriptor itself - it is used before display, to test whether the whole descriptor can be displayed.
Parameters:
const TDesC &aText The descriptor. TInt aWidthInPixels The available width for character display.
Return value:
TInt The number of characters which will be able to be displayed without exceeding the specified width. The count starts from the beginning of the descriptor.
TextCount()
IMPORT_C TInt TextCount(const TDesC &aText, TInt aWidthInPixels) const;
Description: Gets how much of the specified descriptor can be displayed in this font without exceeding the specified width.
Note:
This function does not display any of the descriptor itself - it is used before display, to test whether the whole descriptor can be displayed.
Parameters:
const TDesC &aText The descriptor.
TInt aWidthInPixels The available width for character display.
Return value:
TInt The number of characters which will be able to be displayed without exceeding the specified width. The count starts from the beginning of the descriptor.