开发者

Changing font formattings of selected word/line in a UITextView

开发者 https://www.devze.com 2023-02-03 23:49 出处:网络
Has anyone tried to change the font formatting(bold/italic/color) of a selected word or sentence in a UITextView, like a text editor app开发者_开发技巧lication? I have been trying to do this but it se

Has anyone tried to change the font formatting(bold/italic/color) of a selected word or sentence in a UITextView, like a text editor app开发者_开发技巧lication? I have been trying to do this but it seems formatting is applied only to the whole text, not on individual words or sentences.


you can change any specific word font, style and size also,

Make UITextView text to "Attributed", by default it was "Plain" and then you can perform edition on selected text.


UITextView cannot style text fragments. Styles, colors and fonts are applied to the entire text. You may wish to use a UIWebView or Core Text to render your text instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消