开发者

Glow effect in UITextView

Can glow effects be a开发者_StackOverflow中文版pplied on text inside UITextView? If so, how?


Here is some code to add a red glow to a UITextView. Requires iOS 6+. Adjust parameters to taste:

NSShadow *shadow         = [NSShadow new];
shadow.shadowBlurRadius  = 5;
shadow.shadowColor       = [UIColor redColor];
shadow.shadowOffset      = CGSizeMake(0, 0);

NSDictionary *attributes = @{NSShadowAttributeName:shadow};

textView.attributedText  = [[NSAttributedString alloc]
                                        initWithString:title
                                            attributes:attributes];


Not really. You might be able to use a CSS-styled (using the text-shadow property) <textarea> in a UIWebView, though.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜