Как получить размер NSString, если NSString включает смайлы?IOS

Программируем под IOS
Гость
Как получить размер NSString, если NSString включает смайлы?

Сообщение Гость »


В настоящее время я использую

Код: Выделить всё

- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)lineBreakMode
to get the size of an NSString. However, when that string includes emojis, it seems to calculate the size for the literal unicode character rather than taking into account the size of the emoji itself, rendering the returned size incorrect.

How do I correctly get the size of the string with emoji characters, as it will appear in a uilabel?


Источник: https://stackoverflow.com/questions/159 ... des-emojis

Вернуться в «IOS»