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.
精彩评论