Open ghost opened 10 years ago
@johnSD have you found the answer? I also need work it with UITextView
It's possible since the plugin is relying on attributeText
property of UILabel
which UITextView
also has, I am thinking of rewriting this plugin in Swift 2.0, and by taking advantage of extension/protocol we can avoid lots of code duplication.
In the meantime, you can just copy RQShineLabel.h/m and change the subclass UILabel to UITextView, (perhaps also change ShineLabel to ShineTextView 😉) Things should just work.
Thanks! I done it with change sublacss to UITextView and add some property for mutableAttributedString(because without it i cann't change font family, font size and alignment in my controller)
[mutableAttributedString addAttribute:NSFontAttributeName
value:self.typeSizeFont
range:NSMakeRange(0, mutableAttributedString.length)];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
paragraphStyle.alignment = NSTextAlignmentCenter;
[mutableAttributedString addAttribute:NSParagraphStyleAttributeName
value:paragraphStyle
range:NSMakeRange(0, mutableAttributedString.length)];
can it be done with a uitextview?