开发者

How to change selected text color?

开发者 https://www.devze.com 2023-02-04 18:11 出处:网络
I\'m using UITextView, and I need to change开发者_JAVA技巧 color(or background) of selected text, is it posible and how to implement it?

I'm using UITextView, and I need to change开发者_JAVA技巧 color(or background) of selected text, is it posible and how to implement it?

Thx to all, I've understood that it was bad idea.


Take a look at OHAttributedLabel. You will find it here. It basically allows you to format only parts of a label.


Thanks Joseph for mentionning my OHAttributedLabel class/work :) Hope that helped !

Anyway, since the date of your answer, I did some improvements to my class and fixed some stuff in the code, so don't forget to update / pull from the github repo!

PS: (Sorry for posting a new answer, can't add a comment to an existing answer yet on SO as I just signed in)

0

精彩评论

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

关注公众号